@zyro-sec/gui-plugins 0.0.0-stage → 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.
- package/AGENTS.md +116 -0
- package/README.md +874 -3
- package/bunfig.toml +3 -0
- package/happydom.ts +77 -0
- package/package.json +63 -4
- package/src/browser/activation-delay.ts +134 -0
- package/src/browser/address-machine.ts +468 -0
- package/src/browser/address.ts +111 -0
- package/src/browser/agent-rendering.ts +61 -0
- package/src/browser/analysis.ts +260 -0
- package/src/browser/artifact-link.ts +69 -0
- package/src/browser/artifact-links.ts +55 -0
- package/src/browser/artifact-preview.ts +61 -0
- package/src/browser/assets/viewport-device-chevron.svg +5 -0
- package/src/browser/assets/viewport-rotate.svg +7 -0
- package/src/browser/bar.css +562 -0
- package/src/browser/capture.ts +158 -0
- package/src/browser/cdp.ts +97 -0
- package/src/browser/child-targets.ts +30 -0
- package/src/browser/choices.tsx +42 -0
- package/src/browser/chromium.ts +3018 -0
- package/src/browser/comment.css +38 -0
- package/src/browser/comment.ts +98 -0
- package/src/browser/connection.ts +122 -0
- package/src/browser/default-browser.ts +59 -0
- package/src/browser/diagnostics-machine.ts +522 -0
- package/src/browser/diagnostics.ts +317 -0
- package/src/browser/dialog-machine.ts +268 -0
- package/src/browser/disk/contained-file.ts +43 -0
- package/src/browser/disk/handle-path.fixture.ts +99 -0
- package/src/browser/disk/handle-path.ts +122 -0
- package/src/browser/disk/index.ts +5 -0
- package/src/browser/disk/preview-scope.ts +90 -0
- package/src/browser/electron-address.fixture.ts +143 -0
- package/src/browser/electron-app-badge.fixture.ts +97 -0
- package/src/browser/electron-crash.fixture.ts +216 -0
- package/src/browser/electron-dialogs.fixture.ts +114 -0
- package/src/browser/electron-history.fixture.ts +61 -0
- package/src/browser/electron-icon.fixture.ts +145 -0
- package/src/browser/electron-import-choice.fixture.ts +58 -0
- package/src/browser/electron-links.fixture.ts +549 -0
- package/src/browser/electron-main.ts +85 -0
- package/src/browser/electron-media.fixture.ts +66 -0
- package/src/browser/electron-open.fixture.ts +351 -0
- package/src/browser/electron-page.fixture.ts +253 -0
- package/src/browser/electron-restore.fixture.ts +135 -0
- package/src/browser/electron-run.ts +184 -0
- package/src/browser/electron-sign-in-copy.fixture.ts +365 -0
- package/src/browser/electron-webauthn.fixture.ts +229 -0
- package/src/browser/electron-workers.fixture.ts +54 -0
- package/src/browser/errors.ts +175 -0
- package/src/browser/failure-view.tsx +92 -0
- package/src/browser/failure.ts +174 -0
- package/src/browser/field-value.ts +60 -0
- package/src/browser/file-choosers.ts +42 -0
- package/src/browser/file-verification.ts +18 -0
- package/src/browser/files.ts +134 -0
- package/src/browser/find-bar.tsx +80 -0
- package/src/browser/find-machine.ts +43 -0
- package/src/browser/history/earlier.ts +23 -0
- package/src/browser/history/index.ts +5 -0
- package/src/browser/history/ipc.ts +44 -0
- package/src/browser/history/match.ts +196 -0
- package/src/browser/history/page.ts +86 -0
- package/src/browser/history/search.ts +209 -0
- package/src/browser/history/store.ts +272 -0
- package/src/browser/history/suggest.ts +51 -0
- package/src/browser/history/visits.ts +59 -0
- package/src/browser/host-display.ts +32 -0
- package/src/browser/i18n/am.ts +42 -0
- package/src/browser/i18n/ar.ts +46 -0
- package/src/browser/i18n/az.ts +42 -0
- package/src/browser/i18n/bg.ts +42 -0
- package/src/browser/i18n/bn.ts +42 -0
- package/src/browser/i18n/br.ts +44 -0
- package/src/browser/i18n/bs.ts +43 -0
- package/src/browser/i18n/ca.ts +44 -0
- package/src/browser/i18n/cs.ts +44 -0
- package/src/browser/i18n/da.ts +42 -0
- package/src/browser/i18n/de.ts +43 -0
- package/src/browser/i18n/dv.ts +43 -0
- package/src/browser/i18n/dz.ts +42 -0
- package/src/browser/i18n/el.ts +44 -0
- package/src/browser/i18n/en.ts +455 -0
- package/src/browser/i18n/es.ts +44 -0
- package/src/browser/i18n/et.ts +42 -0
- package/src/browser/i18n/fa.ts +42 -0
- package/src/browser/i18n/fi.ts +42 -0
- package/src/browser/i18n/fo.ts +42 -0
- package/src/browser/i18n/fr.ts +45 -0
- package/src/browser/i18n/he.ts +43 -0
- package/src/browser/i18n/hi.ts +42 -0
- package/src/browser/i18n/hr.ts +43 -0
- package/src/browser/i18n/hu.ts +43 -0
- package/src/browser/i18n/hy.ts +42 -0
- package/src/browser/i18n/id.ts +42 -0
- package/src/browser/i18n/is.ts +42 -0
- package/src/browser/i18n/it.ts +44 -0
- package/src/browser/i18n/ja.ts +42 -0
- package/src/browser/i18n/ka.ts +42 -0
- package/src/browser/i18n/km.ts +42 -0
- package/src/browser/i18n/ko.ts +42 -0
- package/src/browser/i18n/lo.ts +42 -0
- package/src/browser/i18n/lt.ts +44 -0
- package/src/browser/i18n/lv.ts +43 -0
- package/src/browser/i18n/mk.ts +42 -0
- package/src/browser/i18n/mn.ts +42 -0
- package/src/browser/i18n/ms.ts +42 -0
- package/src/browser/i18n/my.ts +43 -0
- package/src/browser/i18n/ne.ts +42 -0
- package/src/browser/i18n/nl.ts +42 -0
- package/src/browser/i18n/no.ts +42 -0
- package/src/browser/i18n/pa.ts +42 -0
- package/src/browser/i18n/pl.ts +44 -0
- package/src/browser/i18n/ro.ts +43 -0
- package/src/browser/i18n/ru.ts +44 -0
- package/src/browser/i18n/si.ts +42 -0
- package/src/browser/i18n/sk.ts +44 -0
- package/src/browser/i18n/sl.ts +44 -0
- package/src/browser/i18n/sq.ts +43 -0
- package/src/browser/i18n/sr.ts +43 -0
- package/src/browser/i18n/sv.ts +42 -0
- package/src/browser/i18n/tg.ts +42 -0
- package/src/browser/i18n/th.ts +42 -0
- package/src/browser/i18n/tk.ts +42 -0
- package/src/browser/i18n/tr.ts +42 -0
- package/src/browser/i18n/uk.ts +44 -0
- package/src/browser/i18n/ur.ts +42 -0
- package/src/browser/i18n/uz.ts +42 -0
- package/src/browser/i18n/vi.ts +42 -0
- package/src/browser/i18n/zh.ts +42 -0
- package/src/browser/i18n/zht.ts +42 -0
- package/src/browser/icon-image.ts +110 -0
- package/src/browser/icon-samples.ts +110 -0
- package/src/browser/icon.ts +72 -0
- package/src/browser/import-prompt.tsx +265 -0
- package/src/browser/index.ts +97 -0
- package/src/browser/ipc.ts +304 -0
- package/src/browser/jobs-machine.ts +181 -0
- package/src/browser/jobs.ts +373 -0
- package/src/browser/keys.ts +109 -0
- package/src/browser/lighthouse.ts +103 -0
- package/src/browser/link.ts +19 -0
- package/src/browser/machine.ts +1522 -0
- package/src/browser/main-machine.ts +99 -0
- package/src/browser/main.ts +394 -0
- package/src/browser/media-gate.ts +131 -0
- package/src/browser/mobile-emulation.ts +121 -0
- package/src/browser/model-machine.ts +93 -0
- package/src/browser/model.ts +1173 -0
- package/src/browser/native-page-menu.ts +189 -0
- package/src/browser/navigation-deadline.ts +20 -0
- package/src/browser/navigation-turn.ts +118 -0
- package/src/browser/network.ts +140 -0
- package/src/browser/notice-actions.ts +52 -0
- package/src/browser/overlay-machine.ts +330 -0
- package/src/browser/page-find.ts +71 -0
- package/src/browser/page-icon.tsx +27 -0
- package/src/browser/page-log.ts +276 -0
- package/src/browser/page-machine.ts +329 -0
- package/src/browser/page-menu.ts +158 -0
- package/src/browser/page-prompts.ts +753 -0
- package/src/browser/pane-machine.ts +664 -0
- package/src/browser/pane.ts +1335 -0
- package/src/browser/panel.fixture.tsx +2046 -0
- package/src/browser/panel.stories.tsx +147 -0
- package/src/browser/panel.tsx +2029 -0
- package/src/browser/passkey-groups.ts +34 -0
- package/src/browser/picker-machine.ts +214 -0
- package/src/browser/plugin-tabs.ts +26 -0
- package/src/browser/policy.ts +439 -0
- package/src/browser/preview.ts +40 -0
- package/src/browser/profile/chromium.ts +198 -0
- package/src/browser/profile/compatibility.ts +177 -0
- package/src/browser/profile/cookie.ts +215 -0
- package/src/browser/profile/database.ts +116 -0
- package/src/browser/profile/electron-import.fixture.ts +43 -0
- package/src/browser/profile/electron-link.fixture.ts +137 -0
- package/src/browser/profile/extension-api/action.ts +276 -0
- package/src/browser/profile/extension-api/api.ts +112 -0
- package/src/browser/profile/extension-api/app-badge.js +19 -0
- package/src/browser/profile/extension-api/context-menus.ts +327 -0
- package/src/browser/profile/extension-api/cookies.ts +192 -0
- package/src/browser/profile/extension-api/event-page.ts +73 -0
- package/src/browser/profile/extension-api/frame-styles.js +46 -0
- package/src/browser/profile/extension-api/host.ts +291 -0
- package/src/browser/profile/extension-api/index.ts +119 -0
- package/src/browser/profile/extension-api/label.ts +4 -0
- package/src/browser/profile/extension-api/manifest.ts +76 -0
- package/src/browser/profile/extension-api/match-pattern.ts +98 -0
- package/src/browser/profile/extension-api/notifications.ts +100 -0
- package/src/browser/profile/extension-api/permissions.ts +51 -0
- package/src/browser/profile/extension-api/popup.ts +200 -0
- package/src/browser/profile/extension-api/preload.js +203 -0
- package/src/browser/profile/extension-api/resource.ts +36 -0
- package/src/browser/profile/extension-api/storage-sync.ts +167 -0
- package/src/browser/profile/extension-api/stubs.ts +152 -0
- package/src/browser/profile/extension-api/styles.ts +230 -0
- package/src/browser/profile/extension-api/tab-activity.ts +23 -0
- package/src/browser/profile/extension-api/tabs.ts +545 -0
- package/src/browser/profile/extension-api/web-navigation.ts +172 -0
- package/src/browser/profile/extension-api/worker-events.ts +114 -0
- package/src/browser/profile/extensions.ts +491 -0
- package/src/browser/profile/filter-startup.fixture.ts +111 -0
- package/src/browser/profile/filter-startup.ts +178 -0
- package/src/browser/profile/firefox.ts +119 -0
- package/src/browser/profile/history.ts +146 -0
- package/src/browser/profile/import.ts +37 -0
- package/src/browser/profile/index.ts +694 -0
- package/src/browser/profile/install.ts +131 -0
- package/src/browser/profile/integrity.ts +56 -0
- package/src/browser/profile/ipc.ts +306 -0
- package/src/browser/profile/link-machine.ts +183 -0
- package/src/browser/profile/link.ts +335 -0
- package/src/browser/profile/made-up-firefox.fixture.ts +67 -0
- package/src/browser/profile/previews.ts +70 -0
- package/src/browser/profile/probe.ts +43 -0
- package/src/browser/profile/range.ts +14 -0
- package/src/browser/profile/review.ts +38 -0
- package/src/browser/profile/safari.ts +77 -0
- package/src/browser/profile/serve.ts +117 -0
- package/src/browser/profile/sites.ts +74 -0
- package/src/browser/profile/sources.ts +682 -0
- package/src/browser/profiling-machine.ts +554 -0
- package/src/browser/profiling.ts +404 -0
- package/src/browser/prompt-gate.ts +41 -0
- package/src/browser/prompt-keys.ts +120 -0
- package/src/browser/prompt-machine.ts +242 -0
- package/src/browser/prompts.tsx +594 -0
- package/src/browser/refs.ts +65 -0
- package/src/browser/refusal-bar.tsx +163 -0
- package/src/browser/refusal-notice.ts +60 -0
- package/src/browser/remote-address.ts +1 -0
- package/src/browser/remote-preview.ts +56 -0
- package/src/browser/renderer.tsx +683 -0
- package/src/browser/restore.ts +77 -0
- package/src/browser/saved-tabs.ts +135 -0
- package/src/browser/scheme.ts +1 -0
- package/src/browser/session-guard.ts +94 -0
- package/src/browser/settings-view.ts +49 -0
- package/src/browser/settings.fixture.tsx +306 -0
- package/src/browser/settings.tsx +1036 -0
- package/src/browser/site-auth.ts +58 -0
- package/src/browser/site-chooser.fixture.tsx +222 -0
- package/src/browser/site-chooser.tsx +778 -0
- package/src/browser/site-keys.ts +35 -0
- package/src/browser/site-machine.ts +134 -0
- package/src/browser/site-permissions.ts +239 -0
- package/src/browser/site-search.ts +26 -0
- package/src/browser/snapshot.ts +440 -0
- package/src/browser/system-media.ts +80 -0
- package/src/browser/tab-openers.ts +65 -0
- package/src/browser/tabs.css +20 -0
- package/src/browser/viewport-controls-machine.ts +134 -0
- package/src/browser/viewport-controls.tsx +170 -0
- package/src/browser/viewport-handles.tsx +119 -0
- package/src/browser/viewport-layout.ts +24 -0
- package/src/browser/viewport-native.ts +99 -0
- package/src/browser/viewport-preset-menu.tsx +69 -0
- package/src/browser/viewport-presets.ts +28 -0
- package/src/browser/viewport-toolbar-machine.ts +94 -0
- package/src/browser/webauthn-gate.ts +222 -0
- package/src/browser/window-open.ts +143 -0
- package/src/browser/wire.ts +20 -0
- package/src/browser/workspace-file.ts +126 -0
- package/src/browser/workspace-pages.ts +156 -0
- package/src/btw/i18n/en.ts +12 -0
- package/src/btw/index.ts +31 -0
- package/src/btw/machine.ts +341 -0
- package/src/btw/model.ts +222 -0
- package/src/btw/panel.tsx +229 -0
- package/src/btw/renderer.tsx +125 -0
- package/src/context/catalog-machine.ts +153 -0
- package/src/context/catalog.ts +123 -0
- package/src/context/export.ts +57 -0
- package/src/context/format.ts +32 -0
- package/src/context/i18n/am.ts +31 -0
- package/src/context/i18n/ar.ts +31 -0
- package/src/context/i18n/az.ts +31 -0
- package/src/context/i18n/bg.ts +31 -0
- package/src/context/i18n/bn.ts +31 -0
- package/src/context/i18n/br.ts +31 -0
- package/src/context/i18n/bs.ts +31 -0
- package/src/context/i18n/ca.ts +31 -0
- package/src/context/i18n/cs.ts +31 -0
- package/src/context/i18n/da.ts +31 -0
- package/src/context/i18n/de.ts +31 -0
- package/src/context/i18n/dv.ts +31 -0
- package/src/context/i18n/dz.ts +31 -0
- package/src/context/i18n/el.ts +31 -0
- package/src/context/i18n/en.ts +31 -0
- package/src/context/i18n/es.ts +31 -0
- package/src/context/i18n/et.ts +31 -0
- package/src/context/i18n/fa.ts +31 -0
- package/src/context/i18n/fi.ts +31 -0
- package/src/context/i18n/fo.ts +31 -0
- package/src/context/i18n/fr.ts +31 -0
- package/src/context/i18n/he.ts +31 -0
- package/src/context/i18n/hi.ts +31 -0
- package/src/context/i18n/hr.ts +31 -0
- package/src/context/i18n/hu.ts +31 -0
- package/src/context/i18n/hy.ts +31 -0
- package/src/context/i18n/id.ts +31 -0
- package/src/context/i18n/is.ts +31 -0
- package/src/context/i18n/it.ts +31 -0
- package/src/context/i18n/ja.ts +31 -0
- package/src/context/i18n/ka.ts +31 -0
- package/src/context/i18n/km.ts +31 -0
- package/src/context/i18n/ko.ts +31 -0
- package/src/context/i18n/lo.ts +31 -0
- package/src/context/i18n/lt.ts +31 -0
- package/src/context/i18n/lv.ts +31 -0
- package/src/context/i18n/mk.ts +31 -0
- package/src/context/i18n/mn.ts +31 -0
- package/src/context/i18n/ms.ts +31 -0
- package/src/context/i18n/my.ts +31 -0
- package/src/context/i18n/ne.ts +31 -0
- package/src/context/i18n/nl.ts +31 -0
- package/src/context/i18n/no.ts +31 -0
- package/src/context/i18n/pa.ts +31 -0
- package/src/context/i18n/pl.ts +31 -0
- package/src/context/i18n/ro.ts +31 -0
- package/src/context/i18n/ru.ts +31 -0
- package/src/context/i18n/si.ts +31 -0
- package/src/context/i18n/sk.ts +31 -0
- package/src/context/i18n/sl.ts +31 -0
- package/src/context/i18n/sq.ts +31 -0
- package/src/context/i18n/sr.ts +31 -0
- package/src/context/i18n/sv.ts +31 -0
- package/src/context/i18n/tg.ts +31 -0
- package/src/context/i18n/th.ts +31 -0
- package/src/context/i18n/tk.ts +31 -0
- package/src/context/i18n/tr.ts +31 -0
- package/src/context/i18n/uk.ts +31 -0
- package/src/context/i18n/ur.ts +31 -0
- package/src/context/i18n/uz.ts +31 -0
- package/src/context/i18n/vi.ts +31 -0
- package/src/context/i18n/zh.ts +31 -0
- package/src/context/i18n/zht.ts +31 -0
- package/src/context/index.ts +71 -0
- package/src/context/indicator.tsx +199 -0
- package/src/context/machine.ts +271 -0
- package/src/context/renderer.tsx +72 -0
- package/src/context/tab.tsx +439 -0
- package/src/debug/bar.tsx +409 -0
- package/src/debug/contract.ts +45 -0
- package/src/debug/focus-machine.ts +84 -0
- package/src/debug/heap-machine.ts +229 -0
- package/src/debug/i18n/am.ts +50 -0
- package/src/debug/i18n/ar.ts +50 -0
- package/src/debug/i18n/az.ts +50 -0
- package/src/debug/i18n/bg.ts +53 -0
- package/src/debug/i18n/bn.ts +50 -0
- package/src/debug/i18n/br.ts +51 -0
- package/src/debug/i18n/bs.ts +52 -0
- package/src/debug/i18n/ca.ts +53 -0
- package/src/debug/i18n/cs.ts +52 -0
- package/src/debug/i18n/da.ts +51 -0
- package/src/debug/i18n/de.ts +50 -0
- package/src/debug/i18n/dv.ts +51 -0
- package/src/debug/i18n/dz.ts +52 -0
- package/src/debug/i18n/el.ts +54 -0
- package/src/debug/i18n/en.ts +50 -0
- package/src/debug/i18n/es.ts +52 -0
- package/src/debug/i18n/et.ts +50 -0
- package/src/debug/i18n/fa.ts +50 -0
- package/src/debug/i18n/fi.ts +50 -0
- package/src/debug/i18n/fo.ts +50 -0
- package/src/debug/i18n/fr.ts +52 -0
- package/src/debug/i18n/he.ts +50 -0
- package/src/debug/i18n/hi.ts +50 -0
- package/src/debug/i18n/hr.ts +52 -0
- package/src/debug/i18n/hu.ts +52 -0
- package/src/debug/i18n/hy.ts +52 -0
- package/src/debug/i18n/id.ts +51 -0
- package/src/debug/i18n/is.ts +50 -0
- package/src/debug/i18n/it.ts +52 -0
- package/src/debug/i18n/ja.ts +50 -0
- package/src/debug/i18n/ka.ts +50 -0
- package/src/debug/i18n/km.ts +50 -0
- package/src/debug/i18n/ko.ts +50 -0
- package/src/debug/i18n/lo.ts +50 -0
- package/src/debug/i18n/lt.ts +51 -0
- package/src/debug/i18n/lv.ts +50 -0
- package/src/debug/i18n/mk.ts +53 -0
- package/src/debug/i18n/mn.ts +52 -0
- package/src/debug/i18n/ms.ts +51 -0
- package/src/debug/i18n/my.ts +53 -0
- package/src/debug/i18n/ne.ts +50 -0
- package/src/debug/i18n/nl.ts +50 -0
- package/src/debug/i18n/no.ts +50 -0
- package/src/debug/i18n/pa.ts +50 -0
- package/src/debug/i18n/pl.ts +51 -0
- package/src/debug/i18n/ro.ts +52 -0
- package/src/debug/i18n/ru.ts +51 -0
- package/src/debug/i18n/si.ts +50 -0
- package/src/debug/i18n/sk.ts +52 -0
- package/src/debug/i18n/sl.ts +50 -0
- package/src/debug/i18n/sq.ts +52 -0
- package/src/debug/i18n/sr.ts +52 -0
- package/src/debug/i18n/sv.ts +51 -0
- package/src/debug/i18n/tg.ts +51 -0
- package/src/debug/i18n/th.ts +50 -0
- package/src/debug/i18n/tk.ts +51 -0
- package/src/debug/i18n/tr.ts +50 -0
- package/src/debug/i18n/uk.ts +50 -0
- package/src/debug/i18n/ur.ts +50 -0
- package/src/debug/i18n/uz.ts +51 -0
- package/src/debug/i18n/vi.ts +51 -0
- package/src/debug/i18n/zh.ts +49 -0
- package/src/debug/i18n/zht.ts +50 -0
- package/src/debug/index.ts +79 -0
- package/src/debug/main.ts +417 -0
- package/src/debug/memory-infra.ts +159 -0
- package/src/debug/memory-log.ts +65 -0
- package/src/debug/memory-machine.ts +151 -0
- package/src/debug/memory-record.ts +36 -0
- package/src/debug/motion-machine.ts +229 -0
- package/src/debug/motion.tsx +697 -0
- package/src/debug/options.ts +15 -0
- package/src/debug/renderer.tsx +185 -0
- package/src/debug/server-heap.ts +63 -0
- package/src/debug/signal.ts +13 -0
- package/src/details/config-action-machine.ts +107 -0
- package/src/details/config-file.ts +43 -0
- package/src/details/details.css +555 -0
- package/src/details/flyout-machine.ts +252 -0
- package/src/details/flyout-motion.ts +26 -0
- package/src/details/i18n/am.ts +68 -0
- package/src/details/i18n/ar.ts +71 -0
- package/src/details/i18n/az.ts +71 -0
- package/src/details/i18n/bg.ts +73 -0
- package/src/details/i18n/bn.ts +71 -0
- package/src/details/i18n/br.ts +71 -0
- package/src/details/i18n/bs.ts +72 -0
- package/src/details/i18n/ca.ts +72 -0
- package/src/details/i18n/cs.ts +71 -0
- package/src/details/i18n/da.ts +71 -0
- package/src/details/i18n/de.ts +73 -0
- package/src/details/i18n/dv.ts +73 -0
- package/src/details/i18n/dz.ts +72 -0
- package/src/details/i18n/el.ts +73 -0
- package/src/details/i18n/en.ts +71 -0
- package/src/details/i18n/es.ts +72 -0
- package/src/details/i18n/et.ts +72 -0
- package/src/details/i18n/fa.ts +71 -0
- package/src/details/i18n/fi.ts +71 -0
- package/src/details/i18n/fo.ts +72 -0
- package/src/details/i18n/fr.ts +73 -0
- package/src/details/i18n/he.ts +71 -0
- package/src/details/i18n/hi.ts +71 -0
- package/src/details/i18n/hr.ts +72 -0
- package/src/details/i18n/hu.ts +72 -0
- package/src/details/i18n/hy.ts +72 -0
- package/src/details/i18n/id.ts +71 -0
- package/src/details/i18n/is.ts +71 -0
- package/src/details/i18n/it.ts +73 -0
- package/src/details/i18n/ja.ts +71 -0
- package/src/details/i18n/ka.ts +72 -0
- package/src/details/i18n/km.ts +72 -0
- package/src/details/i18n/ko.ts +71 -0
- package/src/details/i18n/lo.ts +72 -0
- package/src/details/i18n/lt.ts +72 -0
- package/src/details/i18n/lv.ts +72 -0
- package/src/details/i18n/mk.ts +73 -0
- package/src/details/i18n/mn.ts +71 -0
- package/src/details/i18n/ms.ts +71 -0
- package/src/details/i18n/my.ts +72 -0
- package/src/details/i18n/ne.ts +71 -0
- package/src/details/i18n/nl.ts +71 -0
- package/src/details/i18n/no.ts +71 -0
- package/src/details/i18n/pa.ts +71 -0
- package/src/details/i18n/pl.ts +72 -0
- package/src/details/i18n/ro.ts +72 -0
- package/src/details/i18n/ru.ts +72 -0
- package/src/details/i18n/si.ts +71 -0
- package/src/details/i18n/sk.ts +71 -0
- package/src/details/i18n/sl.ts +73 -0
- package/src/details/i18n/sq.ts +71 -0
- package/src/details/i18n/sr.ts +72 -0
- package/src/details/i18n/sv.ts +72 -0
- package/src/details/i18n/tg.ts +71 -0
- package/src/details/i18n/th.ts +72 -0
- package/src/details/i18n/tk.ts +72 -0
- package/src/details/i18n/tr.ts +71 -0
- package/src/details/i18n/uk.ts +71 -0
- package/src/details/i18n/ur.ts +71 -0
- package/src/details/i18n/uz.ts +72 -0
- package/src/details/i18n/vi.ts +71 -0
- package/src/details/i18n/zh.ts +69 -0
- package/src/details/i18n/zht.ts +70 -0
- package/src/details/index.ts +71 -0
- package/src/details/location-menu.tsx +82 -0
- package/src/details/location-workspace.tsx +39 -0
- package/src/details/mcp-machine.ts +278 -0
- package/src/details/panel.tsx +27 -0
- package/src/details/paths.ts +17 -0
- package/src/details/popover-machine.ts +97 -0
- package/src/details/popover.tsx +179 -0
- package/src/details/renderer.tsx +99 -0
- package/src/details/server-panel.tsx +1632 -0
- package/src/details/service-load-machine.ts +246 -0
- package/src/details/workspace-menu.tsx +490 -0
- package/src/details/workspace-move-machine.ts +643 -0
- package/src/file/apps.ts +25 -0
- package/src/file/arrival-guard-machine.ts +59 -0
- package/src/file/artifact-toolbar.tsx +161 -0
- package/src/file/artifact-view-machine.ts +396 -0
- package/src/file/artifact-view.css +336 -0
- package/src/file/artifact-view.tsx +1031 -0
- package/src/file/artifact.ts +225 -0
- package/src/file/browser.stories.tsx +57 -0
- package/src/file/browser.tsx +502 -0
- package/src/file/context.ts +67 -0
- package/src/file/contract.ts +10 -0
- package/src/file/drag.ts +35 -0
- package/src/file/find.tsx +376 -0
- package/src/file/i18n/am.ts +56 -0
- package/src/file/i18n/ar.ts +64 -0
- package/src/file/i18n/az.ts +56 -0
- package/src/file/i18n/bg.ts +56 -0
- package/src/file/i18n/bn.ts +56 -0
- package/src/file/i18n/br.ts +58 -0
- package/src/file/i18n/bs.ts +58 -0
- package/src/file/i18n/ca.ts +58 -0
- package/src/file/i18n/cs.ts +60 -0
- package/src/file/i18n/da.ts +56 -0
- package/src/file/i18n/de.ts +56 -0
- package/src/file/i18n/dv.ts +56 -0
- package/src/file/i18n/dz.ts +56 -0
- package/src/file/i18n/el.ts +56 -0
- package/src/file/i18n/en.ts +63 -0
- package/src/file/i18n/es.ts +58 -0
- package/src/file/i18n/et.ts +56 -0
- package/src/file/i18n/fa.ts +56 -0
- package/src/file/i18n/fi.ts +56 -0
- package/src/file/i18n/fo.ts +56 -0
- package/src/file/i18n/fr.ts +58 -0
- package/src/file/i18n/he.ts +58 -0
- package/src/file/i18n/hi.ts +56 -0
- package/src/file/i18n/hr.ts +58 -0
- package/src/file/i18n/hu.ts +56 -0
- package/src/file/i18n/hy.ts +56 -0
- package/src/file/i18n/id.ts +56 -0
- package/src/file/i18n/is.ts +56 -0
- package/src/file/i18n/it.ts +58 -0
- package/src/file/i18n/ja.ts +56 -0
- package/src/file/i18n/ka.ts +56 -0
- package/src/file/i18n/km.ts +56 -0
- package/src/file/i18n/ko.ts +56 -0
- package/src/file/i18n/lo.ts +56 -0
- package/src/file/i18n/lt.ts +60 -0
- package/src/file/i18n/lv.ts +58 -0
- package/src/file/i18n/mk.ts +56 -0
- package/src/file/i18n/mn.ts +56 -0
- package/src/file/i18n/ms.ts +56 -0
- package/src/file/i18n/my.ts +56 -0
- package/src/file/i18n/ne.ts +56 -0
- package/src/file/i18n/nl.ts +56 -0
- package/src/file/i18n/no.ts +56 -0
- package/src/file/i18n/pa.ts +56 -0
- package/src/file/i18n/pl.ts +60 -0
- package/src/file/i18n/ro.ts +58 -0
- package/src/file/i18n/ru.ts +60 -0
- package/src/file/i18n/si.ts +56 -0
- package/src/file/i18n/sk.ts +60 -0
- package/src/file/i18n/sl.ts +60 -0
- package/src/file/i18n/sq.ts +56 -0
- package/src/file/i18n/sr.ts +58 -0
- package/src/file/i18n/sv.ts +56 -0
- package/src/file/i18n/tg.ts +56 -0
- package/src/file/i18n/th.ts +56 -0
- package/src/file/i18n/tk.ts +56 -0
- package/src/file/i18n/tr.ts +56 -0
- package/src/file/i18n/uk.ts +60 -0
- package/src/file/i18n/ur.ts +57 -0
- package/src/file/i18n/uz.ts +56 -0
- package/src/file/i18n/vi.ts +56 -0
- package/src/file/i18n/zh.ts +56 -0
- package/src/file/i18n/zht.ts +56 -0
- package/src/file/index.ts +76 -0
- package/src/file/label.tsx +22 -0
- package/src/file/link-exists-machine.ts +137 -0
- package/src/file/link-open-machine.ts +249 -0
- package/src/file/list.tsx +224 -0
- package/src/file/mobile.css +35 -0
- package/src/file/mobile.tsx +116 -0
- package/src/file/open-in-app-machine.ts +185 -0
- package/src/file/open-in-app.tsx +395 -0
- package/src/file/path.ts +43 -0
- package/src/file/picker-machine.ts +190 -0
- package/src/file/pierre-tree-machine.ts +679 -0
- package/src/file/pierre-tree.tsx +503 -0
- package/src/file/renderer.tsx +1030 -0
- package/src/file/resolve-link.ts +152 -0
- package/src/file/scroll-machine.ts +272 -0
- package/src/file/search-machine.ts +202 -0
- package/src/file/styles.ts +5 -0
- package/src/file/tabs.css +15 -0
- package/src/file/tree-focus.css +6 -0
- package/src/file/tree-model.ts +239 -0
- package/src/file/view.tsx +572 -0
- package/src/goal/goal.css +43 -0
- package/src/goal/i18n/en.ts +12 -0
- package/src/goal/icons/active.svg +13 -0
- package/src/goal/icons/complete.svg +4 -0
- package/src/goal/icons/paused.svg +4 -0
- package/src/goal/index.ts +9 -0
- package/src/goal/machine.ts +364 -0
- package/src/goal/renderer.tsx +287 -0
- package/src/icon-name.typecheck.ts +9 -0
- package/src/main.ts +35 -0
- package/src/microsoft-office/document.tsx +436 -0
- package/src/microsoft-office/document.worker.ts +360 -0
- package/src/microsoft-office/fonts-cjk.ts +3 -0
- package/src/microsoft-office/fonts.ts +75 -0
- package/src/microsoft-office/i18n/en.ts +22 -0
- package/src/microsoft-office/index.ts +7 -0
- package/src/microsoft-office/links.ts +22 -0
- package/src/microsoft-office/office-worker.ts +124 -0
- package/src/microsoft-office/pages-machine.ts +356 -0
- package/src/microsoft-office/pages.tsx +387 -0
- package/src/microsoft-office/paper.ts +2 -0
- package/src/microsoft-office/presentation.tsx +303 -0
- package/src/microsoft-office/presentation.worker.ts +373 -0
- package/src/microsoft-office/renderer.tsx +57 -0
- package/src/microsoft-office/sheet-activate.ts +35 -0
- package/src/microsoft-office/sheet-cells.ts +188 -0
- package/src/microsoft-office/sheet-frame-machine.ts +286 -0
- package/src/microsoft-office/sheet-frame.ts +158 -0
- package/src/microsoft-office/sheet-paint.ts +357 -0
- package/src/microsoft-office/sheet-pick-machine.ts +138 -0
- package/src/microsoft-office/sheet-pointer-machine.ts +169 -0
- package/src/microsoft-office/sheet-protocol.ts +88 -0
- package/src/microsoft-office/slide-fonts-machine.ts +290 -0
- package/src/microsoft-office/slide-fonts.ts +157 -0
- package/src/microsoft-office/slide-paint-machine.ts +322 -0
- package/src/microsoft-office/slide-protocol.ts +50 -0
- package/src/microsoft-office/slide-text.ts +334 -0
- package/src/microsoft-office/spreadsheet.tsx +1165 -0
- package/src/microsoft-office/spreadsheet.worker.ts +259 -0
- package/src/microsoft-office/word-images.ts +105 -0
- package/src/microsoft-office/word-layout-machine.ts +219 -0
- package/src/microsoft-office/word-paint-machine.ts +174 -0
- package/src/microsoft-office/word-protocol.ts +78 -0
- package/src/microsoft-office/word-text.ts +260 -0
- package/src/microsoft-office/worker-machine.ts +111 -0
- package/src/microsoft-office/worker-rpc-machine.ts +336 -0
- package/src/microsoft-office/worker-rpc.fixture.ts +90 -0
- package/src/microsoft-office/worker-rpc.ts +292 -0
- package/src/pairing/contract.ts +24 -0
- package/src/pairing/copy-machine.ts +107 -0
- package/src/pairing/dialog.stories.tsx +69 -0
- package/src/pairing/dispatch.ts +42 -0
- package/src/pairing/i18n/en.ts +28 -0
- package/src/pairing/icons/pair.svg +4 -0
- package/src/pairing/index.ts +5 -0
- package/src/pairing/machine.ts +869 -0
- package/src/pairing/main-machine.ts +239 -0
- package/src/pairing/main.ts +130 -0
- package/src/pairing/page.stories.tsx +108 -0
- package/src/pairing/page.tsx +486 -0
- package/src/pairing/remote.ts +7 -0
- package/src/pairing/renderer.tsx +66 -0
- package/src/renderer.ts +55 -0
- package/src/review/contract.ts +31 -0
- package/src/review/detail-machine.ts +250 -0
- package/src/review/folder-machine.ts +404 -0
- package/src/review/i18n/am.ts +23 -0
- package/src/review/i18n/ar.ts +35 -0
- package/src/review/i18n/az.ts +23 -0
- package/src/review/i18n/bg.ts +23 -0
- package/src/review/i18n/bn.ts +23 -0
- package/src/review/i18n/br.ts +27 -0
- package/src/review/i18n/bs.ts +26 -0
- package/src/review/i18n/ca.ts +27 -0
- package/src/review/i18n/cs.ts +29 -0
- package/src/review/i18n/da.ts +23 -0
- package/src/review/i18n/de.ts +23 -0
- package/src/review/i18n/dv.ts +24 -0
- package/src/review/i18n/dz.ts +24 -0
- package/src/review/i18n/el.ts +23 -0
- package/src/review/i18n/en.ts +28 -0
- package/src/review/i18n/es.ts +27 -0
- package/src/review/i18n/et.ts +23 -0
- package/src/review/i18n/fa.ts +23 -0
- package/src/review/i18n/fi.ts +23 -0
- package/src/review/i18n/fo.ts +23 -0
- package/src/review/i18n/fr.ts +27 -0
- package/src/review/i18n/he.ts +26 -0
- package/src/review/i18n/hi.ts +23 -0
- package/src/review/i18n/hr.ts +26 -0
- package/src/review/i18n/hu.ts +23 -0
- package/src/review/i18n/hy.ts +23 -0
- package/src/review/i18n/id.ts +24 -0
- package/src/review/i18n/is.ts +23 -0
- package/src/review/i18n/it.ts +27 -0
- package/src/review/i18n/ja.ts +23 -0
- package/src/review/i18n/ka.ts +23 -0
- package/src/review/i18n/km.ts +23 -0
- package/src/review/i18n/ko.ts +23 -0
- package/src/review/i18n/lo.ts +23 -0
- package/src/review/i18n/lt.ts +29 -0
- package/src/review/i18n/lv.ts +26 -0
- package/src/review/i18n/mk.ts +23 -0
- package/src/review/i18n/mn.ts +23 -0
- package/src/review/i18n/ms.ts +24 -0
- package/src/review/i18n/my.ts +24 -0
- package/src/review/i18n/ne.ts +23 -0
- package/src/review/i18n/nl.ts +23 -0
- package/src/review/i18n/no.ts +23 -0
- package/src/review/i18n/pa.ts +23 -0
- package/src/review/i18n/pl.ts +29 -0
- package/src/review/i18n/ro.ts +26 -0
- package/src/review/i18n/ru.ts +29 -0
- package/src/review/i18n/si.ts +23 -0
- package/src/review/i18n/sk.ts +29 -0
- package/src/review/i18n/sl.ts +29 -0
- package/src/review/i18n/sq.ts +24 -0
- package/src/review/i18n/sr.ts +27 -0
- package/src/review/i18n/sv.ts +23 -0
- package/src/review/i18n/tg.ts +23 -0
- package/src/review/i18n/th.ts +23 -0
- package/src/review/i18n/tk.ts +23 -0
- package/src/review/i18n/tr.ts +23 -0
- package/src/review/i18n/uk.ts +30 -0
- package/src/review/i18n/ur.ts +23 -0
- package/src/review/i18n/uz.ts +23 -0
- package/src/review/i18n/vi.ts +24 -0
- package/src/review/i18n/zh.ts +23 -0
- package/src/review/i18n/zht.ts +23 -0
- package/src/review/index.ts +138 -0
- package/src/review/init-git-machine.ts +152 -0
- package/src/review/kinds.ts +191 -0
- package/src/review/machine.ts +274 -0
- package/src/review/mobile.tsx +91 -0
- package/src/review/model.ts +1123 -0
- package/src/review/panel.stories.tsx +50 -0
- package/src/review/panel.tsx +516 -0
- package/src/review/parts.tsx +141 -0
- package/src/review/render-machine.ts +74 -0
- package/src/review/renderer.tsx +403 -0
- package/src/review/screen-machine.ts +199 -0
- package/src/review/scroll-machine.ts +265 -0
- package/src/review/settings.tsx +28 -0
- package/src/schemes.ts +9 -0
- package/src/sources/i18n/en.ts +3 -0
- package/src/sources/index.ts +4 -0
- package/src/sources/panel.tsx +36 -0
- package/src/sources/renderer.tsx +95 -0
- package/src/ssh/add-machine.ts +63 -0
- package/src/ssh/askpass.ts +94 -0
- package/src/ssh/bootstrap.ts +160 -0
- package/src/ssh/command.ts +243 -0
- package/src/ssh/contract.ts +89 -0
- package/src/ssh/controller.ts +345 -0
- package/src/ssh/cover.tsx +66 -0
- package/src/ssh/dialog-machine.ts +249 -0
- package/src/ssh/dialog.stories.tsx +348 -0
- package/src/ssh/dialog.tsx +236 -0
- package/src/ssh/i18n/am.ts +37 -0
- package/src/ssh/i18n/ar.ts +38 -0
- package/src/ssh/i18n/az.ts +43 -0
- package/src/ssh/i18n/bg.ts +42 -0
- package/src/ssh/i18n/bn.ts +41 -0
- package/src/ssh/i18n/br.ts +43 -0
- package/src/ssh/i18n/bs.ts +43 -0
- package/src/ssh/i18n/ca.ts +43 -0
- package/src/ssh/i18n/cs.ts +43 -0
- package/src/ssh/i18n/da.ts +43 -0
- package/src/ssh/i18n/de.ts +44 -0
- package/src/ssh/i18n/dv.ts +43 -0
- package/src/ssh/i18n/dz.ts +43 -0
- package/src/ssh/i18n/el.ts +45 -0
- package/src/ssh/i18n/en.ts +40 -0
- package/src/ssh/i18n/es.ts +43 -0
- package/src/ssh/i18n/et.ts +41 -0
- package/src/ssh/i18n/fa.ts +39 -0
- package/src/ssh/i18n/fi.ts +40 -0
- package/src/ssh/i18n/fo.ts +41 -0
- package/src/ssh/i18n/fr.ts +43 -0
- package/src/ssh/i18n/he.ts +37 -0
- package/src/ssh/i18n/hi.ts +40 -0
- package/src/ssh/i18n/hr.ts +43 -0
- package/src/ssh/i18n/hu.ts +43 -0
- package/src/ssh/i18n/hy.ts +41 -0
- package/src/ssh/i18n/id.ts +42 -0
- package/src/ssh/i18n/is.ts +40 -0
- package/src/ssh/i18n/it.ts +43 -0
- package/src/ssh/i18n/ja.ts +43 -0
- package/src/ssh/i18n/ka.ts +43 -0
- package/src/ssh/i18n/km.ts +41 -0
- package/src/ssh/i18n/ko.ts +40 -0
- package/src/ssh/i18n/lo.ts +39 -0
- package/src/ssh/i18n/lt.ts +41 -0
- package/src/ssh/i18n/lv.ts +42 -0
- package/src/ssh/i18n/mk.ts +43 -0
- package/src/ssh/i18n/mn.ts +41 -0
- package/src/ssh/i18n/ms.ts +40 -0
- package/src/ssh/i18n/my.ts +41 -0
- package/src/ssh/i18n/ne.ts +39 -0
- package/src/ssh/i18n/nl.ts +43 -0
- package/src/ssh/i18n/no.ts +42 -0
- package/src/ssh/i18n/pa.ts +40 -0
- package/src/ssh/i18n/pl.ts +42 -0
- package/src/ssh/i18n/ro.ts +44 -0
- package/src/ssh/i18n/ru.ts +42 -0
- package/src/ssh/i18n/si.ts +41 -0
- package/src/ssh/i18n/sk.ts +42 -0
- package/src/ssh/i18n/sl.ts +41 -0
- package/src/ssh/i18n/sq.ts +43 -0
- package/src/ssh/i18n/sr.ts +41 -0
- package/src/ssh/i18n/sv.ts +43 -0
- package/src/ssh/i18n/tg.ts +43 -0
- package/src/ssh/i18n/th.ts +38 -0
- package/src/ssh/i18n/tk.ts +41 -0
- package/src/ssh/i18n/tr.ts +42 -0
- package/src/ssh/i18n/uk.ts +40 -0
- package/src/ssh/i18n/ur.ts +40 -0
- package/src/ssh/i18n/uz.ts +43 -0
- package/src/ssh/i18n/vi.ts +42 -0
- package/src/ssh/i18n/zh.ts +36 -0
- package/src/ssh/i18n/zht.ts +36 -0
- package/src/ssh/index.ts +71 -0
- package/src/ssh/main-machine.ts +532 -0
- package/src/ssh/main.ts +75 -0
- package/src/ssh/name.ts +28 -0
- package/src/ssh/remote-cli.ts +137 -0
- package/src/ssh/renderer.tsx +254 -0
- package/src/ssh/row.tsx +97 -0
- package/src/ssh/ssh.css +35 -0
- package/src/ssh/state.ts +217 -0
- package/src/ssh/window-machine.ts +533 -0
- package/src/terminal/connection-machine.ts +285 -0
- package/src/terminal/connection.ts +112 -0
- package/src/terminal/dispatch.ts +44 -0
- package/src/terminal/focus-machine.ts +112 -0
- package/src/terminal/focus.ts +23 -0
- package/src/terminal/hover-label.ts +20 -0
- package/src/terminal/i18n/am.ts +28 -0
- package/src/terminal/i18n/ar.ts +28 -0
- package/src/terminal/i18n/az.ts +29 -0
- package/src/terminal/i18n/bg.ts +29 -0
- package/src/terminal/i18n/bn.ts +28 -0
- package/src/terminal/i18n/br.ts +29 -0
- package/src/terminal/i18n/bs.ts +29 -0
- package/src/terminal/i18n/ca.ts +28 -0
- package/src/terminal/i18n/cs.ts +28 -0
- package/src/terminal/i18n/da.ts +28 -0
- package/src/terminal/i18n/de.ts +29 -0
- package/src/terminal/i18n/dv.ts +28 -0
- package/src/terminal/i18n/dz.ts +28 -0
- package/src/terminal/i18n/el.ts +30 -0
- package/src/terminal/i18n/en.ts +30 -0
- package/src/terminal/i18n/es.ts +28 -0
- package/src/terminal/i18n/et.ts +28 -0
- package/src/terminal/i18n/fa.ts +28 -0
- package/src/terminal/i18n/fi.ts +29 -0
- package/src/terminal/i18n/fo.ts +28 -0
- package/src/terminal/i18n/fr.ts +29 -0
- package/src/terminal/i18n/he.ts +28 -0
- package/src/terminal/i18n/hi.ts +28 -0
- package/src/terminal/i18n/hr.ts +28 -0
- package/src/terminal/i18n/hu.ts +28 -0
- package/src/terminal/i18n/hy.ts +29 -0
- package/src/terminal/i18n/id.ts +28 -0
- package/src/terminal/i18n/is.ts +28 -0
- package/src/terminal/i18n/it.ts +28 -0
- package/src/terminal/i18n/ja.ts +29 -0
- package/src/terminal/i18n/ka.ts +29 -0
- package/src/terminal/i18n/km.ts +28 -0
- package/src/terminal/i18n/ko.ts +28 -0
- package/src/terminal/i18n/lo.ts +28 -0
- package/src/terminal/i18n/lt.ts +29 -0
- package/src/terminal/i18n/lv.ts +28 -0
- package/src/terminal/i18n/mk.ts +29 -0
- package/src/terminal/i18n/mn.ts +30 -0
- package/src/terminal/i18n/ms.ts +28 -0
- package/src/terminal/i18n/my.ts +29 -0
- package/src/terminal/i18n/ne.ts +28 -0
- package/src/terminal/i18n/nl.ts +28 -0
- package/src/terminal/i18n/no.ts +28 -0
- package/src/terminal/i18n/pa.ts +28 -0
- package/src/terminal/i18n/pl.ts +28 -0
- package/src/terminal/i18n/ro.ts +28 -0
- package/src/terminal/i18n/ru.ts +28 -0
- package/src/terminal/i18n/si.ts +28 -0
- package/src/terminal/i18n/sk.ts +28 -0
- package/src/terminal/i18n/sl.ts +28 -0
- package/src/terminal/i18n/sq.ts +29 -0
- package/src/terminal/i18n/sr.ts +28 -0
- package/src/terminal/i18n/sv.ts +28 -0
- package/src/terminal/i18n/tg.ts +29 -0
- package/src/terminal/i18n/th.ts +28 -0
- package/src/terminal/i18n/tk.ts +29 -0
- package/src/terminal/i18n/tr.ts +29 -0
- package/src/terminal/i18n/uk.ts +28 -0
- package/src/terminal/i18n/ur.ts +28 -0
- package/src/terminal/i18n/uz.ts +29 -0
- package/src/terminal/i18n/vi.ts +28 -0
- package/src/terminal/i18n/zh.ts +28 -0
- package/src/terminal/i18n/zht.ts +28 -0
- package/src/terminal/index.ts +74 -0
- package/src/terminal/inline-rename.ts +93 -0
- package/src/terminal/label.tsx +71 -0
- package/src/terminal/machine.ts +767 -0
- package/src/terminal/model.ts +661 -0
- package/src/terminal/pane-machine.ts +260 -0
- package/src/terminal/panel.tsx +280 -0
- package/src/terminal/props.ts +16 -0
- package/src/terminal/quote-machine.ts +381 -0
- package/src/terminal/quote.css +7 -0
- package/src/terminal/quote.tsx +218 -0
- package/src/terminal/rename-machine.ts +98 -0
- package/src/terminal/renderer.tsx +298 -0
- package/src/terminal/runtime-adapters.ts +34 -0
- package/src/terminal/surface-machine.ts +186 -0
- package/src/terminal/tab.tsx +112 -0
- package/src/terminal/terminal-key-event.ts +58 -0
- package/src/terminal/terminal.fixture.tsx +71 -0
- package/src/terminal/terminal.tsx +652 -0
- package/src/terminal/title.ts +41 -0
- package/src/terminal/writer.ts +87 -0
- package/src/updater/action.ts +37 -0
- package/src/updater/actions.tsx +110 -0
- package/src/updater/i18n/am.ts +40 -0
- package/src/updater/i18n/ar.ts +40 -0
- package/src/updater/i18n/az.ts +41 -0
- package/src/updater/i18n/bg.ts +40 -0
- package/src/updater/i18n/bn.ts +41 -0
- package/src/updater/i18n/br.ts +40 -0
- package/src/updater/i18n/bs.ts +41 -0
- package/src/updater/i18n/ca.ts +41 -0
- package/src/updater/i18n/cs.ts +41 -0
- package/src/updater/i18n/da.ts +40 -0
- package/src/updater/i18n/de.ts +41 -0
- package/src/updater/i18n/dv.ts +41 -0
- package/src/updater/i18n/dz.ts +42 -0
- package/src/updater/i18n/el.ts +42 -0
- package/src/updater/i18n/en.ts +42 -0
- package/src/updater/i18n/es.ts +40 -0
- package/src/updater/i18n/et.ts +40 -0
- package/src/updater/i18n/fa.ts +40 -0
- package/src/updater/i18n/fi.ts +41 -0
- package/src/updater/i18n/fo.ts +40 -0
- package/src/updater/i18n/fr.ts +41 -0
- package/src/updater/i18n/he.ts +40 -0
- package/src/updater/i18n/hi.ts +40 -0
- package/src/updater/i18n/hr.ts +41 -0
- package/src/updater/i18n/hu.ts +40 -0
- package/src/updater/i18n/hy.ts +41 -0
- package/src/updater/i18n/id.ts +41 -0
- package/src/updater/i18n/is.ts +40 -0
- package/src/updater/i18n/it.ts +40 -0
- package/src/updater/i18n/ja.ts +41 -0
- package/src/updater/i18n/ka.ts +40 -0
- package/src/updater/i18n/km.ts +40 -0
- package/src/updater/i18n/ko.ts +40 -0
- package/src/updater/i18n/lo.ts +40 -0
- package/src/updater/i18n/lt.ts +41 -0
- package/src/updater/i18n/lv.ts +40 -0
- package/src/updater/i18n/mk.ts +41 -0
- package/src/updater/i18n/mn.ts +40 -0
- package/src/updater/i18n/ms.ts +41 -0
- package/src/updater/i18n/my.ts +40 -0
- package/src/updater/i18n/ne.ts +40 -0
- package/src/updater/i18n/nl.ts +41 -0
- package/src/updater/i18n/no.ts +40 -0
- package/src/updater/i18n/pa.ts +40 -0
- package/src/updater/i18n/pl.ts +41 -0
- package/src/updater/i18n/ro.ts +41 -0
- package/src/updater/i18n/ru.ts +40 -0
- package/src/updater/i18n/si.ts +40 -0
- package/src/updater/i18n/sk.ts +41 -0
- package/src/updater/i18n/sl.ts +40 -0
- package/src/updater/i18n/sq.ts +40 -0
- package/src/updater/i18n/sr.ts +41 -0
- package/src/updater/i18n/sv.ts +40 -0
- package/src/updater/i18n/tg.ts +41 -0
- package/src/updater/i18n/th.ts +40 -0
- package/src/updater/i18n/tk.ts +40 -0
- package/src/updater/i18n/tr.ts +40 -0
- package/src/updater/i18n/uk.ts +40 -0
- package/src/updater/i18n/ur.ts +40 -0
- package/src/updater/i18n/uz.ts +41 -0
- package/src/updater/i18n/vi.ts +41 -0
- package/src/updater/i18n/zh.ts +40 -0
- package/src/updater/i18n/zht.ts +40 -0
- package/src/updater/index.ts +94 -0
- package/src/updater/log.ts +41 -0
- package/src/updater/machine.ts +919 -0
- package/src/updater/main.ts +138 -0
- package/src/updater/platform.ts +160 -0
- package/src/updater/renderer.tsx +203 -0
- package/src/updater/section.tsx +65 -0
- package/src/updater/web-driver.ts +200 -0
- package/src/updater/web-machine.ts +222 -0
- package/src/updater/web.tsx +103 -0
- package/src/updater/whats-new-machine.ts +97 -0
- package/src/updater/whats-new.stories.tsx +38 -0
- package/src/updater/whats-new.tsx +304 -0
- package/src/updater/window-machine.ts +73 -0
- package/src/wsl/add-machine.ts +56 -0
- package/src/wsl/contract.ts +104 -0
- package/src/wsl/dialog-machine.ts +322 -0
- package/src/wsl/dialog.css +372 -0
- package/src/wsl/dialog.tsx +492 -0
- package/src/wsl/i18n/am.ts +53 -0
- package/src/wsl/i18n/ar.ts +55 -0
- package/src/wsl/i18n/az.ts +57 -0
- package/src/wsl/i18n/bg.ts +58 -0
- package/src/wsl/i18n/bn.ts +56 -0
- package/src/wsl/i18n/br.ts +58 -0
- package/src/wsl/i18n/bs.ts +58 -0
- package/src/wsl/i18n/ca.ts +58 -0
- package/src/wsl/i18n/cs.ts +57 -0
- package/src/wsl/i18n/da.ts +57 -0
- package/src/wsl/i18n/de.ts +59 -0
- package/src/wsl/i18n/dv.ts +58 -0
- package/src/wsl/i18n/dz.ts +59 -0
- package/src/wsl/i18n/el.ts +57 -0
- package/src/wsl/i18n/en.ts +55 -0
- package/src/wsl/i18n/es.ts +58 -0
- package/src/wsl/i18n/et.ts +55 -0
- package/src/wsl/i18n/fa.ts +56 -0
- package/src/wsl/i18n/fi.ts +57 -0
- package/src/wsl/i18n/fo.ts +56 -0
- package/src/wsl/i18n/fr.ts +57 -0
- package/src/wsl/i18n/he.ts +54 -0
- package/src/wsl/i18n/hi.ts +57 -0
- package/src/wsl/i18n/hr.ts +58 -0
- package/src/wsl/i18n/hu.ts +58 -0
- package/src/wsl/i18n/hy.ts +57 -0
- package/src/wsl/i18n/id.ts +56 -0
- package/src/wsl/i18n/is.ts +55 -0
- package/src/wsl/i18n/it.ts +57 -0
- package/src/wsl/i18n/ja.ts +57 -0
- package/src/wsl/i18n/ka.ts +56 -0
- package/src/wsl/i18n/km.ts +57 -0
- package/src/wsl/i18n/ko.ts +56 -0
- package/src/wsl/i18n/lo.ts +54 -0
- package/src/wsl/i18n/lt.ts +57 -0
- package/src/wsl/i18n/lv.ts +57 -0
- package/src/wsl/i18n/mk.ts +57 -0
- package/src/wsl/i18n/mn.ts +58 -0
- package/src/wsl/i18n/ms.ts +57 -0
- package/src/wsl/i18n/my.ts +57 -0
- package/src/wsl/i18n/ne.ts +57 -0
- package/src/wsl/i18n/nl.ts +57 -0
- package/src/wsl/i18n/no.ts +57 -0
- package/src/wsl/i18n/pa.ts +57 -0
- package/src/wsl/i18n/pl.ts +58 -0
- package/src/wsl/i18n/ro.ts +56 -0
- package/src/wsl/i18n/ru.ts +57 -0
- package/src/wsl/i18n/si.ts +56 -0
- package/src/wsl/i18n/sk.ts +57 -0
- package/src/wsl/i18n/sl.ts +57 -0
- package/src/wsl/i18n/sq.ts +56 -0
- package/src/wsl/i18n/sr.ts +57 -0
- package/src/wsl/i18n/sv.ts +58 -0
- package/src/wsl/i18n/tg.ts +57 -0
- package/src/wsl/i18n/th.ts +57 -0
- package/src/wsl/i18n/tk.ts +56 -0
- package/src/wsl/i18n/tr.ts +57 -0
- package/src/wsl/i18n/uk.ts +57 -0
- package/src/wsl/i18n/ur.ts +57 -0
- package/src/wsl/i18n/uz.ts +57 -0
- package/src/wsl/i18n/vi.ts +56 -0
- package/src/wsl/i18n/zh.ts +53 -0
- package/src/wsl/i18n/zht.ts +53 -0
- package/src/wsl/index.ts +72 -0
- package/src/wsl/local.ts +41 -0
- package/src/wsl/machine.ts +652 -0
- package/src/wsl/main.ts +95 -0
- package/src/wsl/model.ts +369 -0
- package/src/wsl/probe-machine.ts +143 -0
- package/src/wsl/probes.ts +107 -0
- package/src/wsl/remote-cli.ts +49 -0
- package/src/wsl/renderer.tsx +164 -0
- package/src/wsl/row-view.ts +25 -0
- package/src/wsl/row.tsx +76 -0
- package/src/wsl/runtime.ts +441 -0
- package/src/wsl/servers.ts +330 -0
- package/src/wsl/sidecar.ts +186 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import { createServer, type ServerResponse } from "node:http"
|
|
2
|
+
import path from "node:path"
|
|
3
|
+
import electron from "electron"
|
|
4
|
+
import type { BuiltinMainStorage } from "@zyro-sec/plugin/gui/builtin"
|
|
5
|
+
import type { Embeds } from "@zyro-sec/plugin/gui/main"
|
|
6
|
+
import type { RefusalNotice } from "./ipc"
|
|
7
|
+
import type { BindingEvent } from "./pane-machine"
|
|
8
|
+
import type { TabActivity } from "./policy"
|
|
9
|
+
|
|
10
|
+
// The Electron main process of `electron-links.test.ts`, bundled and run by the pinned Electron. It opens one pane page
|
|
11
|
+
// on a made-up page of links and presses them as the person does, through Chromium's own input events: with the
|
|
12
|
+
// middle button, with Ctrl (Cmd on macOS) and Shift, plainly, and with Enter on the focused link. The agent then
|
|
13
|
+
// middle-clicks the same link, and two more pages ask for a tab with nobody's press. It prints the tabs and notices
|
|
14
|
+
// each press led to as one JSON line.
|
|
15
|
+
//
|
|
16
|
+
// One more page acts on its own 50 ms, 500 ms or 2 s after the person's press, with its renderer slowed: its frame from
|
|
17
|
+
// another site calls `window.open`, or it clicks a link of its own with Shift. Neither is the person's. Each gets a
|
|
18
|
+
// press of its own, since the first request after a press uses that press up.
|
|
19
|
+
//
|
|
20
|
+
// Some links lead to a download, to another app's link or to an address the pane refuses, as the first navigation of
|
|
21
|
+
// the tab they open. Every download here gets its save path in this process's own `will-download` listener, before the
|
|
22
|
+
// page's handler sees it, so none can open the system's save dialog.
|
|
23
|
+
|
|
24
|
+
// One row of 40px every 50px, so a press at (20, 50 * row + 20) lands on that row.
|
|
25
|
+
const links = `<!doctype html><title>Links</title>
|
|
26
|
+
<style>a,div{position:fixed;left:0;width:300px;height:40px;display:block}</style>
|
|
27
|
+
<a href="/target?plain" style="top:0">Plain link</a>
|
|
28
|
+
<a href="/target?blank" target="_blank" style="top:50px">Blank link</a>
|
|
29
|
+
<a href="mailto:someone@example.test" style="top:100px">Mail link</a>
|
|
30
|
+
<div style="top:150px">No link</div>
|
|
31
|
+
<a href="/target?opener" target="_blank" rel="opener" style="top:200px">Opener link</a>
|
|
32
|
+
<a href="/download" style="top:250px">Download link</a>
|
|
33
|
+
<a href="/download" target="_blank" style="top:300px">Blank download link</a>
|
|
34
|
+
<a href="/to-mail" style="top:350px">Mail redirect</a>
|
|
35
|
+
<a href="/to-refused" style="top:400px">Refused redirect</a>
|
|
36
|
+
<a href="/then-download" style="top:450px">Page then download</a>
|
|
37
|
+
<a href="/slow" style="top:500px">Slow link</a>
|
|
38
|
+
<script>
|
|
39
|
+
window.presses = 0
|
|
40
|
+
window.moves = 0
|
|
41
|
+
for (const type of ["click", "auxclick"]) addEventListener(type, () => window.presses++, true)
|
|
42
|
+
addEventListener("pointermove", () => window.moves++, true)
|
|
43
|
+
</script>`
|
|
44
|
+
|
|
45
|
+
// A Shift+click the page makes up by itself asks for a new window, as the person's would.
|
|
46
|
+
const synthetic = `<!doctype html><title>Synthetic</title><a href="/target?synthetic">Link</a><script>
|
|
47
|
+
setTimeout(() => document.querySelector("a").dispatchEvent(new MouseEvent("click", { shiftKey: true, bubbles: true, cancelable: true })), 50)
|
|
48
|
+
</script>`
|
|
49
|
+
|
|
50
|
+
// What a page does on its own after a real press, as `window.plan` says: it tells its frame from another site, which the
|
|
51
|
+
// press gave no activation, to open a window, or it clicks another link with Shift. A real press on its link navigates
|
|
52
|
+
// nowhere.
|
|
53
|
+
const afterPress = `<!doctype html><title>After press</title>
|
|
54
|
+
<style>a,div{position:fixed;left:0;width:300px;height:40px;display:block}</style>
|
|
55
|
+
<div style="top:0">Elsewhere</div>
|
|
56
|
+
<a href="/target?prevented" style="top:50px">Prevented link</a>
|
|
57
|
+
<a id="other" href="/target" style="top:100px">Other link</a>
|
|
58
|
+
<iframe src="http://localhost:PORT/opener" style="position:fixed;top:200px;left:0;width:300px;height:60px"></iframe>
|
|
59
|
+
<script>
|
|
60
|
+
window.presses = 0
|
|
61
|
+
window.moves = 0
|
|
62
|
+
addEventListener("pointermove", () => window.moves++, true)
|
|
63
|
+
addEventListener("message", () => { window.ready = true })
|
|
64
|
+
addEventListener("click", (event) => {
|
|
65
|
+
if (!event.isTrusted) return
|
|
66
|
+
window.presses++
|
|
67
|
+
if (event.target.closest("a")) event.preventDefault()
|
|
68
|
+
const { kind, delay } = window.plan
|
|
69
|
+
if (kind === "frame") return frames[0].postMessage(delay, "*")
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
const other = document.getElementById("other")
|
|
72
|
+
other.href = "/target?made-up-" + delay
|
|
73
|
+
other.dispatchEvent(new MouseEvent("click", { shiftKey: true, bubbles: true, cancelable: true }))
|
|
74
|
+
}, delay)
|
|
75
|
+
}, true)
|
|
76
|
+
</script>`
|
|
77
|
+
|
|
78
|
+
// The frame keeps its renderer busy before the window it asks for.
|
|
79
|
+
const opener = `<!doctype html><title>Opener</title><script>
|
|
80
|
+
addEventListener("message", (event) => {
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
for (const end = performance.now() + 20; performance.now() < end; );
|
|
83
|
+
window.open("/target?frame-" + event.data)
|
|
84
|
+
}, event.data)
|
|
85
|
+
})
|
|
86
|
+
parent.postMessage("ready", "*")
|
|
87
|
+
</script>`
|
|
88
|
+
|
|
89
|
+
const unprompted = `<!doctype html><title>Unprompted</title><script>setTimeout(() => window.open("/target?timer"), 50)</script>`
|
|
90
|
+
|
|
91
|
+
// A document that commits, then leaves for a download by itself.
|
|
92
|
+
const thenDownload = `<!doctype html><title>Then download</title><script>setTimeout(() => { location.href = "/download" }, 50)</script>`
|
|
93
|
+
|
|
94
|
+
function served(path: string | undefined) {
|
|
95
|
+
if (path === "/links") return links
|
|
96
|
+
|
|
97
|
+
if (path === "/then-download") return thenDownload
|
|
98
|
+
|
|
99
|
+
if (path === "/opener") return opener
|
|
100
|
+
|
|
101
|
+
if (path === "/synthetic") return synthetic
|
|
102
|
+
|
|
103
|
+
if (path === "/unprompted") return unprompted
|
|
104
|
+
|
|
105
|
+
return "<!doctype html><title>Target</title><p>target</p>"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
void electron.app.whenReady().then(async () => {
|
|
109
|
+
const { Schema } = await import("effect")
|
|
110
|
+
const { Browser } = await import("@zyro-sec/plugin-browser/rpc")
|
|
111
|
+
const { createBrowserPage } = await import("./chromium")
|
|
112
|
+
const { createHandlePath } = await import("./disk")
|
|
113
|
+
const { createPaneState, selectBinding, transitionPane } = await import("./pane-machine")
|
|
114
|
+
const { activityOwner } = await import("./policy")
|
|
115
|
+
const { createSitePermissions } = await import("./site-permissions")
|
|
116
|
+
const { createSystemMedia } = await import("./system-media")
|
|
117
|
+
// Downloads whose last bytes wait, so a test decides whether its tab closed before the download ended.
|
|
118
|
+
const held = new Set<ServerResponse>()
|
|
119
|
+
|
|
120
|
+
const server = createServer((request, response) => {
|
|
121
|
+
if (request.url === "/favicon.ico") return void response.writeHead(404).end()
|
|
122
|
+
|
|
123
|
+
if (request.url === "/download") {
|
|
124
|
+
response.writeHead(200, { "content-type": "application/octet-stream", "content-disposition": 'attachment; filename="report.bin"' })
|
|
125
|
+
response.write("made-up ")
|
|
126
|
+
|
|
127
|
+
return void held.add(response)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// A server that is slow to answer, and a document whose title comes later still, as a real site's does.
|
|
131
|
+
if (request.url === "/slow")
|
|
132
|
+
return void setTimeout(() => {
|
|
133
|
+
response.writeHead(200, { "content-type": "text/html" })
|
|
134
|
+
response.write("<!doctype html><meta charset=utf-8>")
|
|
135
|
+
setTimeout(() => response.end("<title>Slow</title><p>slow</p>"), 300)
|
|
136
|
+
}, 300)
|
|
137
|
+
|
|
138
|
+
if (request.url === "/to-mail") return void response.writeHead(302, { location: "mailto:someone@example.test" }).end()
|
|
139
|
+
|
|
140
|
+
// An address with a password, which the pane opens nowhere.
|
|
141
|
+
if (request.url === "/to-refused")
|
|
142
|
+
return void response.writeHead(302, { location: `http://someone:secret@${request.headers.host}/target?refused` }).end()
|
|
143
|
+
|
|
144
|
+
if (request.url === "/after-press") {
|
|
145
|
+
response.writeHead(200, { "content-type": "text/html" })
|
|
146
|
+
|
|
147
|
+
return void response.end(afterPress.replace("PORT", String(request.headers.host).split(":")[1] ?? ""))
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
response.writeHead(200, { "content-type": "text/html" })
|
|
151
|
+
response.end(served(request.url))
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve))
|
|
155
|
+
const address = server.address()
|
|
156
|
+
const port = address instanceof Object ? address.port : 0
|
|
157
|
+
const origin = `http://127.0.0.1:${port}`
|
|
158
|
+
// Never shown and never focused: the presses below are Chromium input events, not the system's.
|
|
159
|
+
const win = new electron.BrowserWindow({ show: false, width: 800, height: 600 })
|
|
160
|
+
const partition = "links-fixture"
|
|
161
|
+
const verifier = createHandlePath()
|
|
162
|
+
const values = new Map<string, unknown>()
|
|
163
|
+
|
|
164
|
+
type Page = ReturnType<typeof createBrowserPage>
|
|
165
|
+
|
|
166
|
+
// Each page by its web contents, as the pane keeps each tab's download handler (`downloads` in pane.ts).
|
|
167
|
+
const pages = new Map<number, Page>()
|
|
168
|
+
const downloads: { url: string; state: string; updated: boolean }[] = []
|
|
169
|
+
|
|
170
|
+
for (const session of [electron.session.fromPartition(partition), electron.session.defaultSession])
|
|
171
|
+
session.on("will-download", (_event, item, source) => {
|
|
172
|
+
// First, and whatever follows: an item with a save path asks nobody where to save it. The file lands in this
|
|
173
|
+
// run's own profile folder, which the test removes.
|
|
174
|
+
item.setSavePath(path.join(electron.app.getPath("userData"), "downloads", `download-${downloads.length}`))
|
|
175
|
+
const download = { url: item.getURL().replace(origin, ""), state: item.getState(), updated: false }
|
|
176
|
+
downloads.push(download)
|
|
177
|
+
// As the session's one listener hands a download to the tab that started it (session-guard.ts).
|
|
178
|
+
pages.get(source.id)?.download(item)
|
|
179
|
+
// Added after the page's own listeners, so the page has answered an update before this says there was one.
|
|
180
|
+
item.on("updated", () => {
|
|
181
|
+
download.updated = true
|
|
182
|
+
})
|
|
183
|
+
item.once("done", (_done, state) => {
|
|
184
|
+
download.state = state
|
|
185
|
+
download.updated = true
|
|
186
|
+
})
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
// SAFETY: the site permissions read only `store` and its `value` and `set`.
|
|
190
|
+
// oxlint-disable-next-line anti-slop/no-chained-type-assertions -- see SAFETY above
|
|
191
|
+
const storage = {
|
|
192
|
+
store: (key: string, options: { initial: unknown }) => ({
|
|
193
|
+
get value() {
|
|
194
|
+
return values.has(key) ? values.get(key) : options.initial
|
|
195
|
+
},
|
|
196
|
+
// oxlint-disable-next-line anti-slop/no-unknown-parameters -- see SAFETY above
|
|
197
|
+
set: (next: unknown) => values.set(key, next),
|
|
198
|
+
}),
|
|
199
|
+
} as unknown as BuiltinMainStorage
|
|
200
|
+
|
|
201
|
+
// The window host owns bounds and occlusion; here every view fills the window and shows when its page says so.
|
|
202
|
+
const embeds: Embeds = {
|
|
203
|
+
create(view, window) {
|
|
204
|
+
window.contentView.addChildView(view)
|
|
205
|
+
view.setBounds({ x: 0, y: 0, width: 800, height: 600 })
|
|
206
|
+
|
|
207
|
+
return {
|
|
208
|
+
id: "embed",
|
|
209
|
+
show: (visible) => view.setVisible(visible),
|
|
210
|
+
on: () => () => undefined,
|
|
211
|
+
capture: async () => undefined,
|
|
212
|
+
dispose: () => window.contentView.removeChildView(view),
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const signal = new AbortController().signal
|
|
218
|
+
const refs = { next: 0 }
|
|
219
|
+
const sites = createSitePermissions(storage, () => undefined)
|
|
220
|
+
const system = createSystemMedia()
|
|
221
|
+
const made = { count: 0 }
|
|
222
|
+
|
|
223
|
+
// What the page asked the pane for: each tab with whether it stays behind the current one, and each notice.
|
|
224
|
+
type Opened = {
|
|
225
|
+
readonly background: boolean
|
|
226
|
+
readonly owner: string
|
|
227
|
+
closed: boolean
|
|
228
|
+
readonly notices: RefusalNotice[]
|
|
229
|
+
/** Its page in the pane's machine, once it is listed there. */
|
|
230
|
+
attempt?: number
|
|
231
|
+
/**
|
|
232
|
+
* What the pane told the window about this tab, in order, each time it changed: whether the strip keeps its new-tab
|
|
233
|
+
* label, its title, whether it loads, its address, and with the report that first lists it, where it stands.
|
|
234
|
+
*/
|
|
235
|
+
readonly reports: string[]
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const opened: Opened[] = []
|
|
239
|
+
const tabs = new Map<Opened, Page>()
|
|
240
|
+
const notices: RefusalNotice[] = []
|
|
241
|
+
const listed = new Map<string, Opened>()
|
|
242
|
+
|
|
243
|
+
// The pane's own machine, which decides what the window's strip is told about each tab from what its page publishes.
|
|
244
|
+
const pane = {
|
|
245
|
+
state: transitionPane(
|
|
246
|
+
transitionPane(createPaneState(), { type: "registered", binding: "links", window: win.id, storageKey: "links", restore: undefined, saved: { tabs: [], focusedTabID: null } }).state,
|
|
247
|
+
{ type: "binding", binding: "links", event: { type: "server.attached", fileRoots: [] } },
|
|
248
|
+
).state,
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const dispatch = (event: BindingEvent) => {
|
|
252
|
+
const next = transitionPane(pane.state, { type: "binding", binding: "links", event })
|
|
253
|
+
pane.state = next.state
|
|
254
|
+
|
|
255
|
+
for (const effect of next.effects) {
|
|
256
|
+
if (effect.type !== "report" || effect.event.type !== "state") continue
|
|
257
|
+
const told = effect.event
|
|
258
|
+
|
|
259
|
+
told.state?.tabs.forEach((tab) => {
|
|
260
|
+
const report = [
|
|
261
|
+
told.unnamed?.includes(tab.id) ? "new-tab label," : "page's title,",
|
|
262
|
+
tab.title.replace(`127.0.0.1:${port}`, "") || "untitled",
|
|
263
|
+
tab.loading ? "loading" : "loaded",
|
|
264
|
+
tab.url.replace(origin, ""),
|
|
265
|
+
...(told.placed?.tabID === tab.id ? [told.placed.after === tabID ? "after the pressed tab" : "after another tab"] : []),
|
|
266
|
+
].join(" ")
|
|
267
|
+
|
|
268
|
+
const reports = listed.get(tab.id)?.reports
|
|
269
|
+
|
|
270
|
+
if (reports && reports.at(-1) !== report) reports.push(report)
|
|
271
|
+
})
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
type Opening = Extract<BindingEvent, { readonly type: "tab.opened" }>
|
|
276
|
+
|
|
277
|
+
// Lists a new page as the pane does (`create` in pane.ts), and says which page of its tab it is.
|
|
278
|
+
const list = (tab: Opening["tab"], beside?: Opening["beside"]) => {
|
|
279
|
+
const attempt = selectBinding(pane.state, "links")?.nextAttempt ?? 0
|
|
280
|
+
dispatch({ type: "tab.opened", tabID: tab.id, attempt, tab, beside })
|
|
281
|
+
|
|
282
|
+
return attempt
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// A page as the pane makes it (`create` in pane.ts). One a link or script opened adopts Chromium's new contents, says
|
|
286
|
+
// its own notices, and can close itself or hand an address back to the tab that opened it.
|
|
287
|
+
const make = (activity: TabActivity, popup?: { readonly options: Electron.BrowserWindowConstructorOptions; readonly tab: Opened; readonly refused: (url: string) => void }): Page => {
|
|
288
|
+
const created = createBrowserPage(win, {
|
|
289
|
+
id: Browser.TabID.make(`tab_${String(++made.count).padStart(8, "0")}-1111-1111-1111-111111111111`),
|
|
290
|
+
toolbar: false,
|
|
291
|
+
partition,
|
|
292
|
+
network: null,
|
|
293
|
+
popupOptions: popup?.options,
|
|
294
|
+
initialize: popup ? false : undefined,
|
|
295
|
+
opened: popup && {
|
|
296
|
+
close: () => {
|
|
297
|
+
const page = tabs.get(popup.tab)
|
|
298
|
+
|
|
299
|
+
if (!page || popup.tab.closed) return
|
|
300
|
+
popup.tab.closed = true
|
|
301
|
+
pages.delete(page.contents.id)
|
|
302
|
+
void page.dispose()
|
|
303
|
+
},
|
|
304
|
+
refused: popup.refused,
|
|
305
|
+
},
|
|
306
|
+
publish: () => {
|
|
307
|
+
const tab = popup && tabs.get(popup.tab)?.state()
|
|
308
|
+
|
|
309
|
+
if (tab && popup.tab.attempt !== undefined) dispatch({ type: "tab.published", tabID: tab.id, attempt: popup.tab.attempt, tab })
|
|
310
|
+
},
|
|
311
|
+
refused: (notice) => (popup ? popup.tab.notices : notices).push(notice),
|
|
312
|
+
fail: () => undefined,
|
|
313
|
+
popup: (options, background, child, refused) => {
|
|
314
|
+
const tab: Opened = { background, owner: activityOwner(child), closed: false, notices: [], reports: [] }
|
|
315
|
+
const page = make(child, { options, tab, refused })
|
|
316
|
+
opened.push(tab)
|
|
317
|
+
tabs.set(tab, page)
|
|
318
|
+
listed.set(page.state().id, tab)
|
|
319
|
+
// The person's tab stands beside the one it came from; the agent's goes to the end.
|
|
320
|
+
tab.attempt = list(page.state(), tab.owner === "agent" ? undefined : { tabID: created.state().id, front: !background })
|
|
321
|
+
|
|
322
|
+
return page.contents
|
|
323
|
+
},
|
|
324
|
+
activity,
|
|
325
|
+
userInput: () => undefined,
|
|
326
|
+
local: true,
|
|
327
|
+
signal,
|
|
328
|
+
shared: { ref: () => `e${++refs.next}` },
|
|
329
|
+
menu: { t: (key) => key, extensions: () => [], navigate: async () => undefined, open: async () => undefined, verifier },
|
|
330
|
+
embeds,
|
|
331
|
+
sites,
|
|
332
|
+
system,
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
pages.set(created.contents.id, created)
|
|
336
|
+
// A tab that closes before it is ready fails its start, which the pane expects too (`create` in pane.ts).
|
|
337
|
+
void created.ready.catch(() => undefined)
|
|
338
|
+
|
|
339
|
+
return created
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const activity: TabActivity = { agentRuns: 0 }
|
|
343
|
+
const page = make(activity)
|
|
344
|
+
const tabID = page.state().id
|
|
345
|
+
list(page.state())
|
|
346
|
+
await page.ready
|
|
347
|
+
|
|
348
|
+
const turn = () => new Promise<void>((resolve) => setTimeout(resolve, 20))
|
|
349
|
+
|
|
350
|
+
// Bounded, so a press that leads to nothing fails the test's comparison instead of hanging the fixture.
|
|
351
|
+
const until = async (done: () => boolean | Promise<boolean>) => {
|
|
352
|
+
for (const deadline = Date.now() + 10_000; Date.now() < deadline && !(await done()); ) await turn()
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const count = (name: "presses" | "moves") => page.contents.executeJavaScript(`window.${name} ?? 0`).then(Number, () => 0)
|
|
356
|
+
|
|
357
|
+
const presses = () => count("presses")
|
|
358
|
+
|
|
359
|
+
const go = async (path: string) => {
|
|
360
|
+
await page.execute({ action: { type: "navigate", tabID, url: origin + path }, files: [] }, signal, "user")
|
|
361
|
+
// A hidden window's page is throttled and takes no input. The agent's commands lift that themselves; the person's
|
|
362
|
+
// window is on screen.
|
|
363
|
+
page.contents.setBackgroundThrottling(false)
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Addresses as paths, whichever of the server's two sites they are on.
|
|
367
|
+
const local = (notice: RefusalNotice) =>
|
|
368
|
+
"target" in notice ? { ...notice, target: notice.target.replace(origin, "").replace(`http://localhost:${port}`, "") } : notice
|
|
369
|
+
|
|
370
|
+
// What happened since `before`: the new tabs, each once its first navigation has ended in a page, a notice, a
|
|
371
|
+
// download or its own closing; the new notices of the pressed page; and the new downloads, once they have ended.
|
|
372
|
+
const outcome = async (before: { opened: number; notices: number; downloads: number }, downloading = false) => {
|
|
373
|
+
const started = () => downloads.slice(before.downloads)
|
|
374
|
+
|
|
375
|
+
if (downloading) await until(() => started().some((download) => download.updated))
|
|
376
|
+
|
|
377
|
+
const shown = await Promise.all(
|
|
378
|
+
opened.slice(before.opened).map(async (tab) => {
|
|
379
|
+
const page = tabs.get(tab)
|
|
380
|
+
|
|
381
|
+
if (!page) return tab
|
|
382
|
+
await page.ready.catch(() => undefined)
|
|
383
|
+
await until(() => tab.closed || tab.notices.length > 0 || started().some((download) => download.updated) || (!!page.contents.getURL() && !page.contents.isLoading()))
|
|
384
|
+
|
|
385
|
+
return tab
|
|
386
|
+
}),
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
// Only now do the downloads get their last bytes: each has already met its tab open or closed.
|
|
390
|
+
const met = started().map((download) => ({ download, tab: shown.some((tab) => tab.closed) ? "closed" : "open" }))
|
|
391
|
+
held.forEach((response) => response.end("bytes"))
|
|
392
|
+
held.clear()
|
|
393
|
+
await until(() => started().every((download) => download.state !== "progressing"))
|
|
394
|
+
|
|
395
|
+
const listed = await Promise.all(
|
|
396
|
+
shown.map(async (tab) => {
|
|
397
|
+
const page = tabs.get(tab)
|
|
398
|
+
const base = { background: tab.background, owner: tab.owner }
|
|
399
|
+
|
|
400
|
+
if (!page || tab.closed) return { ...base, closed: true }
|
|
401
|
+
const url = page.state().url.replace(origin, "")
|
|
402
|
+
// A tab with no document has no window to ask.
|
|
403
|
+
const opener: unknown = page.contents.getURL() ? await page.contents.executeJavaScript("window.opener === null ? 'none' : 'opener'") : undefined
|
|
404
|
+
pages.delete(page.contents.id)
|
|
405
|
+
await page.dispose()
|
|
406
|
+
|
|
407
|
+
// What is undefined is left out of the printed line.
|
|
408
|
+
return { ...base, url, opener, notices: tab.notices.length ? tab.notices.map(local) : undefined }
|
|
409
|
+
}),
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
return {
|
|
413
|
+
tabs: listed,
|
|
414
|
+
notices: notices.slice(before.notices).map(local),
|
|
415
|
+
owner: activityOwner(activity),
|
|
416
|
+
downloads: met.length ? met.map((item) => ({ url: item.download.url, state: item.download.state, tab: item.tab })) : undefined,
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const mark = () => ({ opened: opened.length, notices: notices.length, downloads: downloads.length })
|
|
421
|
+
|
|
422
|
+
// The person's press, as Chromium receives one from the system.
|
|
423
|
+
const press = async (row: number, button: "left" | "middle", modifiers: ("shift" | "control" | "meta")[] = [], downloading = false) => {
|
|
424
|
+
const before = mark()
|
|
425
|
+
const seen = await presses()
|
|
426
|
+
const at = { x: 20, y: row * 50 + 20 }
|
|
427
|
+
// The pointer is on what it presses, as a person's is.
|
|
428
|
+
page.contents.sendInputEvent({ type: "mouseMove", ...at, modifiers })
|
|
429
|
+
page.contents.sendInputEvent({ type: "mouseDown", ...at, button, clickCount: 1, modifiers })
|
|
430
|
+
page.contents.sendInputEvent({ type: "mouseUp", ...at, button, clickCount: 1, modifiers })
|
|
431
|
+
// The page saw the click, and what it asked the pane for followed: a tab or a notice, or neither.
|
|
432
|
+
await until(async () => (await presses()) > seen)
|
|
433
|
+
await until(async () => opened.length > before.opened || notices.length > before.notices || (await presses()) > seen)
|
|
434
|
+
await turn()
|
|
435
|
+
|
|
436
|
+
return outcome(before, downloading)
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// The person's Enter on the plain link, which Chromium opens as it opens a click with the same modifiers.
|
|
440
|
+
const enter = async (modifiers: ("shift" | "control" | "meta")[]) => {
|
|
441
|
+
const before = mark()
|
|
442
|
+
await page.contents.executeJavaScript("document.querySelector('a').focus()")
|
|
443
|
+
|
|
444
|
+
for (const type of ["keyDown", "char", "keyUp"] as const) page.contents.sendInputEvent({ type, keyCode: "Enter", modifiers })
|
|
445
|
+
await until(() => opened.length > before.opened || notices.length > before.notices)
|
|
446
|
+
|
|
447
|
+
return outcome(before)
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// The agent's click on a link, through its own click command.
|
|
451
|
+
const agentPress = async (name: string, button: "left" | "middle", downloading = false) => {
|
|
452
|
+
const before = mark()
|
|
453
|
+
const snapshot = await page.execute({ action: { type: "snapshot", tabID }, files: [] }, signal, "agent")
|
|
454
|
+
const content = Schema.decodeUnknownSync(Schema.Struct({ content: Schema.String }))(snapshot.value).content
|
|
455
|
+
const ref = new RegExp(`@(e\\d+) \\[link\\] "${name}"`).exec(content)?.[1]
|
|
456
|
+
|
|
457
|
+
if (!ref) throw new Error(`The snapshot names no ${name}:\n${content}`)
|
|
458
|
+
|
|
459
|
+
const refusal = await page
|
|
460
|
+
.execute({ action: { type: "click", tabID, ref: Browser.Ref.make(ref), button }, files: [] }, signal, "agent")
|
|
461
|
+
.then(
|
|
462
|
+
() => undefined,
|
|
463
|
+
(error: Error) => error.message,
|
|
464
|
+
)
|
|
465
|
+
|
|
466
|
+
if (!refusal) await until(() => notices.length > before.notices || opened.length > before.opened)
|
|
467
|
+
|
|
468
|
+
return { ...(await outcome(before, downloading)), refusal }
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// A plain press on the page that then acts on its own: one request follows it, which is not the person's.
|
|
472
|
+
const pressThenWait = async (row: number, kind: "frame" | "made-up", delay: number) => {
|
|
473
|
+
await page.contents.executeJavaScript(`window.plan = ${JSON.stringify({ kind, delay })}`)
|
|
474
|
+
const before = mark()
|
|
475
|
+
const at = { x: 20, y: row * 50 + 20 }
|
|
476
|
+
page.contents.sendInputEvent({ type: "mouseMove", ...at })
|
|
477
|
+
page.contents.sendInputEvent({ type: "mouseDown", ...at, button: "left", clickCount: 1 })
|
|
478
|
+
page.contents.sendInputEvent({ type: "mouseUp", ...at, button: "left", clickCount: 1 })
|
|
479
|
+
await until(() => notices.length > before.notices || opened.length > before.opened)
|
|
480
|
+
await turn()
|
|
481
|
+
|
|
482
|
+
return { on: row ? "link" : "elsewhere", kind, delay, ...(await outcome(before)) }
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// A page that asks for a tab by itself, with nobody's press.
|
|
486
|
+
const unasked = async (path: string) => {
|
|
487
|
+
const before = mark()
|
|
488
|
+
await go(path)
|
|
489
|
+
await until(() => notices.length > before.notices || opened.length > before.opened)
|
|
490
|
+
|
|
491
|
+
return outcome(before)
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
await go("/links")
|
|
495
|
+
// The page takes input once it has painted.
|
|
496
|
+
await until(async () => {
|
|
497
|
+
page.contents.sendInputEvent({ type: "mouseMove", x: 500 + (Date.now() % 2), y: 500 })
|
|
498
|
+
|
|
499
|
+
return (await count("moves")) > 0
|
|
500
|
+
})
|
|
501
|
+
const modifier = process.platform === "darwin" ? "meta" : "control"
|
|
502
|
+
// First, while the pressed tab is the only other one: a link to a slow page, middle-clicked.
|
|
503
|
+
const slow = await press(10, "middle")
|
|
504
|
+
const reports = opened[0]?.reports
|
|
505
|
+
const middle = await press(0, "middle")
|
|
506
|
+
const modified = await press(0, "left", [modifier])
|
|
507
|
+
const modifiedShift = await press(0, "left", [modifier, "shift"])
|
|
508
|
+
const middleShift = await press(0, "middle", ["shift"])
|
|
509
|
+
const shift = await press(0, "left", ["shift"])
|
|
510
|
+
const blank = await press(1, "left")
|
|
511
|
+
const blankMiddle = await press(1, "middle")
|
|
512
|
+
const mail = await press(2, "left")
|
|
513
|
+
const mailMiddle = await press(2, "middle")
|
|
514
|
+
const nothing = await press(3, "middle")
|
|
515
|
+
const opener = await press(4, "left")
|
|
516
|
+
const openerMiddle = await press(4, "middle")
|
|
517
|
+
const key = await enter([modifier])
|
|
518
|
+
const download = await press(5, "middle", [], true)
|
|
519
|
+
const blankDownload = await press(6, "left", [], true)
|
|
520
|
+
const mailRedirect = await press(7, "middle")
|
|
521
|
+
const refusedRedirect = await press(8, "middle")
|
|
522
|
+
const thenDownloaded = await press(9, "middle", [], true)
|
|
523
|
+
const agent = await agentPress("Plain link", "middle")
|
|
524
|
+
const agentDownload = await agentPress("Blank download link", "left", true)
|
|
525
|
+
const reclaimed = await press(0, "middle")
|
|
526
|
+
const synthesized = await unasked("/synthetic")
|
|
527
|
+
const timer = await unasked("/unprompted")
|
|
528
|
+
await go("/after-press")
|
|
529
|
+
await until(async () => {
|
|
530
|
+
page.contents.sendInputEvent({ type: "mouseMove", x: 500 + (Date.now() % 2), y: 500 })
|
|
531
|
+
|
|
532
|
+
return (await count("moves")) > 0 && (await page.contents.executeJavaScript("window.ready === true"))
|
|
533
|
+
})
|
|
534
|
+
// A slow renderer, so a report that could arrive late would.
|
|
535
|
+
await page.contents.debugger.sendCommand("Emulation.setCPUThrottlingRate", { rate: 4 })
|
|
536
|
+
const afterwards: Awaited<ReturnType<typeof pressThenWait>>[] = []
|
|
537
|
+
|
|
538
|
+
for (const row of [0, 1])
|
|
539
|
+
for (const kind of ["frame", "made-up"] as const)
|
|
540
|
+
for (const delay of [50, 500, 2000]) afterwards.push(await pressThenWait(row, kind, delay))
|
|
541
|
+
|
|
542
|
+
process.stdout.write(
|
|
543
|
+
`${JSON.stringify({ platform: process.platform, slow, reports, middle, modified, modifiedShift, middleShift, shift, blank, blankMiddle, mail, mailMiddle, nothing, opener, openerMiddle, key, download, blankDownload, mailRedirect, refusedRedirect, thenDownload: thenDownloaded, agent, agentDownload, reclaimed, synthetic: synthesized, timer, afterPress: afterwards })}\n`,
|
|
544
|
+
)
|
|
545
|
+
await page.dispose()
|
|
546
|
+
server.closeAllConnections()
|
|
547
|
+
server.close()
|
|
548
|
+
electron.app.quit()
|
|
549
|
+
})
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import electron from "electron"
|
|
2
|
+
import type { Caller, Ipc, IpcImpl, IpcSpec, MainContext } from "@zyro-sec/plugin/gui/main"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The browser plugin's own main entry, run in the Electron of a real-Electron fixture, and the two Ipcs it provides as
|
|
6
|
+
* a window calls them. No pane is registered, so no window, server or page is asked for. `close` ends the plugin.
|
|
7
|
+
*/
|
|
8
|
+
export async function runBrowserMain() {
|
|
9
|
+
const { default: setup } = await import("./main")
|
|
10
|
+
const { BrowserHistory } = await import("./history/ipc")
|
|
11
|
+
const { BrowserProfile } = await import("./profile/ipc")
|
|
12
|
+
const values = new Map<string, unknown>()
|
|
13
|
+
const provided = new Map<string, IpcImpl<IpcSpec>>()
|
|
14
|
+
const cleanups: (() => void | Promise<void>)[] = []
|
|
15
|
+
const logged: string[] = []
|
|
16
|
+
const lifetime = new AbortController()
|
|
17
|
+
|
|
18
|
+
// SAFETY: the main entry and the profile read of the context only what is here: storage as a map of values, the
|
|
19
|
+
// log, the Ipcs they provide and their cleanup.
|
|
20
|
+
// oxlint-disable-next-line anti-slop/no-chained-type-assertions -- see SAFETY above
|
|
21
|
+
const ctx = {
|
|
22
|
+
id: "browser",
|
|
23
|
+
signal: lifetime.signal,
|
|
24
|
+
t: (key: string) => key,
|
|
25
|
+
app: { name: "opencode", version: "0.0.0", channel: "local", platform: "desktop", packaged: false },
|
|
26
|
+
log: { write: (_level: string, message: string) => void logged.push(message) },
|
|
27
|
+
storage: {
|
|
28
|
+
store: (key: string, options: { initial: unknown }) => ({
|
|
29
|
+
get value() {
|
|
30
|
+
return values.has(key) ? values.get(key) : options.initial
|
|
31
|
+
},
|
|
32
|
+
ready: () => true,
|
|
33
|
+
// oxlint-disable-next-line anti-slop/no-unknown-parameters -- see SAFETY above
|
|
34
|
+
set: (next: unknown) => void values.set(key, next),
|
|
35
|
+
// oxlint-disable-next-line anti-slop/no-unknown-parameters -- see SAFETY above
|
|
36
|
+
update(mutate: (draft: unknown) => void) {
|
|
37
|
+
const draft = structuredClone(values.has(key) ? values.get(key) : options.initial)
|
|
38
|
+
mutate(draft)
|
|
39
|
+
values.set(key, draft)
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
remove: (key: string) => void values.delete(key),
|
|
43
|
+
},
|
|
44
|
+
windows: { get: () => undefined, list: () => [], focused: () => undefined, on: () => () => undefined },
|
|
45
|
+
serverEndpoints: { get: () => undefined },
|
|
46
|
+
provide: (token: { readonly id: string }, impl: IpcImpl<IpcSpec>) => {
|
|
47
|
+
provided.set(token.id, impl)
|
|
48
|
+
|
|
49
|
+
return { changed: () => undefined, emit: () => undefined }
|
|
50
|
+
},
|
|
51
|
+
add: () => () => undefined,
|
|
52
|
+
onCleanup: (cleanup: () => void | Promise<void>) => void cleanups.push(cleanup),
|
|
53
|
+
} as unknown as MainContext
|
|
54
|
+
|
|
55
|
+
await setup(ctx)
|
|
56
|
+
|
|
57
|
+
// SAFETY: `provide` above received each Ipc's own implementation from the main entry, whose type the token carries.
|
|
58
|
+
const ipc = <S extends IpcSpec>(token: Ipc<S>) => provided.get(token.id) as IpcImpl<S>
|
|
59
|
+
const caller: Caller = { window: 1, signal: lifetime.signal }
|
|
60
|
+
const session = electron.session.fromPartition("persist:opencode-browser")
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
profile: ipc(BrowserProfile),
|
|
64
|
+
history: ipc(BrowserHistory),
|
|
65
|
+
caller,
|
|
66
|
+
/** The browser's own cookie store, which an import writes. */
|
|
67
|
+
session,
|
|
68
|
+
/** How many cookies the browser has. */
|
|
69
|
+
cookies: async () => (await session.cookies.get({})).length,
|
|
70
|
+
/** What the desktop log received. */
|
|
71
|
+
logged,
|
|
72
|
+
/** What a window's call comes to: the answer, or the rejection. */
|
|
73
|
+
outcome: <A>(call: () => A | Promise<A>) =>
|
|
74
|
+
Promise.resolve()
|
|
75
|
+
.then(call)
|
|
76
|
+
.then(
|
|
77
|
+
(value) => ({ value }),
|
|
78
|
+
() => ({ rejected: true }),
|
|
79
|
+
),
|
|
80
|
+
async close() {
|
|
81
|
+
lifetime.abort()
|
|
82
|
+
await Promise.all(cleanups.map((cleanup) => cleanup()))
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
}
|