@zyro-sec/gui-plugins 0.0.0-stage → 1.0.4
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,439 @@
|
|
|
1
|
+
// URL policy shared by the pane and page. Electron-free so it stays unit-testable under Bun.
|
|
2
|
+
|
|
3
|
+
import { Browser } from "@zyro-sec/plugin-browser/rpc"
|
|
4
|
+
import { encodeFilePath } from "@zyro-sec/util/path"
|
|
5
|
+
import { remotePath } from "./remote-address"
|
|
6
|
+
import { artifactAddress } from "./artifact-link"
|
|
7
|
+
import { windowsPreviewSegment } from "@zyro-sec/plugin-browser/preview-path"
|
|
8
|
+
|
|
9
|
+
export function destinationOrigin(input: string) {
|
|
10
|
+
if (!URL.canParse(input)) return
|
|
11
|
+
const url = new URL(input)
|
|
12
|
+
|
|
13
|
+
return /^https?:$/.test(url.protocol) && !url.username && !url.password ? url.origin : undefined
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** A file URL for this machine: no host, so UNC shares and remote hosts are rejected. */
|
|
17
|
+
export function localFileURL(input: string) {
|
|
18
|
+
if (!URL.canParse(input)) return
|
|
19
|
+
const url = new URL(input)
|
|
20
|
+
|
|
21
|
+
return url.protocol === "file:" && !url.hostname ? url.href : undefined
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** A filesystem path in the form paths compare in: slashes, no leading slash before a drive, any case on Windows. */
|
|
25
|
+
function canonicalPath(path: string) {
|
|
26
|
+
const value = path.replaceAll("\\", "/").replace(/^\/([A-Za-z]:\/)/, "$1")
|
|
27
|
+
|
|
28
|
+
return process.platform === "win32" ? value.toLowerCase() : value
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The filesystem path a file URL names, or undefined when its escapes do not decode or could step out of a folder. */
|
|
32
|
+
function filePath(url: URL) {
|
|
33
|
+
// An escaped separator or dot segment decodes into a path the URL parser never normalized.
|
|
34
|
+
if (/%(?:2f|5c)/i.test(url.pathname)) return undefined
|
|
35
|
+
|
|
36
|
+
const decoded = (() => {
|
|
37
|
+
try {
|
|
38
|
+
return decodeURIComponent(url.pathname)
|
|
39
|
+
} catch {
|
|
40
|
+
return undefined
|
|
41
|
+
}
|
|
42
|
+
})()
|
|
43
|
+
|
|
44
|
+
if (
|
|
45
|
+
decoded === undefined ||
|
|
46
|
+
decoded.includes("\0") ||
|
|
47
|
+
decoded.split(/[\\/]/).some((part) => part === "." || part === "..")
|
|
48
|
+
)
|
|
49
|
+
return undefined
|
|
50
|
+
|
|
51
|
+
if (
|
|
52
|
+
process.platform === "win32" &&
|
|
53
|
+
!decoded
|
|
54
|
+
.replace(/^\/[a-z]:\//i, "")
|
|
55
|
+
.split("/")
|
|
56
|
+
.every(windowsPreviewSegment)
|
|
57
|
+
)
|
|
58
|
+
return undefined
|
|
59
|
+
|
|
60
|
+
return canonicalPath(decoded)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Whether a file URL points inside one of the allowed directories. The agent already has read
|
|
65
|
+
* access to the session's workspace, so files there may be shown; anything else stays behind the
|
|
66
|
+
* server's file permissions. The roots are filesystem paths, compared as written; a URL whose path cannot be compared
|
|
67
|
+
* with them is outside.
|
|
68
|
+
*/
|
|
69
|
+
export function fileURLWithin(input: string, roots: ReadonlyArray<string>) {
|
|
70
|
+
const href = localFileURL(input)
|
|
71
|
+
|
|
72
|
+
if (!href || roots.length === 0) return false
|
|
73
|
+
const path = filePath(new URL(href))
|
|
74
|
+
|
|
75
|
+
if (path === undefined) return false
|
|
76
|
+
|
|
77
|
+
return roots.some((root) => {
|
|
78
|
+
const prefix = canonicalPath(root).replace(/\/+$/, "")
|
|
79
|
+
|
|
80
|
+
return path === prefix || path.startsWith(`${prefix}/`)
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** A page of one of the loaded extensions, such as its popup or options page. */
|
|
85
|
+
export function extensionURL(input: string, extensions: ReadonlyArray<string>) {
|
|
86
|
+
if (!URL.canParse(input)) return false
|
|
87
|
+
const url = new URL(input)
|
|
88
|
+
|
|
89
|
+
return url.protocol === "chrome-extension:" && extensions.includes(url.hostname)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Each Chromium permission an extension's page may hold, with the manifest permission that grants it. */
|
|
93
|
+
const extensionGrants = [
|
|
94
|
+
["clipboard-read", "clipboardRead"],
|
|
95
|
+
["clipboard-sanitized-write", "clipboardWrite"],
|
|
96
|
+
["notifications", "notifications"],
|
|
97
|
+
] as const
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Whether a page asking from `origin` gets `permission`. A web page gets none. An extension's page (its popup, options
|
|
101
|
+
* page or blob:) gets the clipboard and notifications when the extension's manifest declares them, as Chrome grants
|
|
102
|
+
* them, so a password manager can copy a password; `declared` reads that manifest's permissions by extension ID.
|
|
103
|
+
*/
|
|
104
|
+
export function pagePermission(permission: string, origin: string, declared: (id: string) => ReadonlyArray<unknown>) {
|
|
105
|
+
if (!URL.canParse(origin)) return false
|
|
106
|
+
const url = new URL(origin)
|
|
107
|
+
const document = url.protocol === "blob:" && URL.canParse(url.pathname) ? new URL(url.pathname) : url
|
|
108
|
+
const needed = extensionGrants.find(([name]) => name === permission)?.[1]
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
document.protocol === "chrome-extension:" && needed !== undefined && declared(document.hostname).includes(needed)
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* `control` is absent on a person's untouched tab; reclaimed only by input or a person-issued command, never by elapsed
|
|
117
|
+
* time. `agentRuns` counts the agent's commands in flight that act on the page; its `wait` only observes and is left out.
|
|
118
|
+
*/
|
|
119
|
+
export type TabActivity = { agentRuns: number; control?: "agent" | "reclaimed" }
|
|
120
|
+
|
|
121
|
+
export function recordPageInput(activity: TabActivity, origin: "agent" | "user") {
|
|
122
|
+
if (origin === "agent") activity.control = "agent"
|
|
123
|
+
|
|
124
|
+
if (origin === "user" && agentDriven(activity)) activity.control = "reclaimed"
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** An agent focus is an agent operation. A strip selection (including auto-reveal) is not input to the page. */
|
|
128
|
+
export function recordTabFocus(activity: TabActivity, origin: "agent" | "user") {
|
|
129
|
+
if (origin === "agent") recordPageInput(activity, origin)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Permission, passkey and prompt-focus restrictions outlive even an explicit human takeover. */
|
|
133
|
+
export function agentDriven(activity: Readonly<TabActivity>): boolean {
|
|
134
|
+
return activity.agentRuns > 0 || activity.control !== undefined
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** A child inherits provenance, not its opener's in-flight run counter. */
|
|
138
|
+
export function childActivity(activity: Readonly<TabActivity>): TabActivity {
|
|
139
|
+
return activity.agentRuns ? { ...activity, agentRuns: 0, control: "agent" } : { ...activity }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* What an agent's `tabs.open` or `tabs.focus` shows the person: the tab, in the pane, which opens for it. Only
|
|
144
|
+
* `tabs.open` with `focus: false` keeps a new tab in the background, and an explicit focus shows even such a tab.
|
|
145
|
+
*/
|
|
146
|
+
export function agentTabShow(action: { readonly type: "tabs.open" | "tabs.focus"; readonly focus?: boolean }) {
|
|
147
|
+
return action.type === "tabs.open" && action.focus === false
|
|
148
|
+
? ({ reveal: "none", background: true } as const)
|
|
149
|
+
: ({ reveal: "tab", background: false } as const)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Whose a new tab is, by who made it: the agent's own tab is the agent's; one a page made (a pop-up, its menu's new
|
|
154
|
+
* tab, an extension acting on it) carries that `opener`'s provenance; one the person made is the person's. An agent
|
|
155
|
+
* command in flight in another tab is not provenance: nothing about other tabs reaches here.
|
|
156
|
+
*/
|
|
157
|
+
export function createdActivity(origin: "agent" | "user", opener?: Readonly<TabActivity>): TabActivity {
|
|
158
|
+
if (origin === "agent") return { agentRuns: 0, control: "agent" }
|
|
159
|
+
|
|
160
|
+
return opener ? childActivity(opener) : { agentRuns: 0 }
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Extension bytes must not go to the agent; neither may an agent-driven extension download open a native picker.
|
|
165
|
+
*/
|
|
166
|
+
export function downloadOwner(
|
|
167
|
+
download: TabActivity & { readonly page: ReadonlyArray<string>; readonly chain: ReadonlyArray<string> },
|
|
168
|
+
): "agent" | "user" | "block" {
|
|
169
|
+
if (activityOwner(download) === "user") return "user"
|
|
170
|
+
|
|
171
|
+
return [...download.page, ...download.chain].some(Browser.extensionOrigin) ? "block" : "agent"
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** A page timer, an idle period and selecting the strip do not authorize a native dialog. */
|
|
175
|
+
export function activityOwner(activity: Readonly<TabActivity>): "agent" | "user" {
|
|
176
|
+
return activity.agentRuns > 0 || activity.control === "agent" ? "agent" : "user"
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Actions that only take a tab away from its document, which the agent may run on an extension page to leave it. */
|
|
180
|
+
const leaving = ["navigate", "back", "forward", "stop"]
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Why the agent may not run `action` in a tab whose main frame shows `page`, or undefined when it may. The agent never
|
|
184
|
+
* opens an extension page, and never reads or acts on one, even one the user opened: evaluating there would run with
|
|
185
|
+
* the extension's privileges. The user's own commands do not pass through here.
|
|
186
|
+
*/
|
|
187
|
+
export function agentRefusal(
|
|
188
|
+
action: { readonly type: string; readonly url?: string },
|
|
189
|
+
page: { readonly url: string; readonly origin: string },
|
|
190
|
+
) {
|
|
191
|
+
if (
|
|
192
|
+
(action.type === "navigate" || action.type === "tabs.open") &&
|
|
193
|
+
action.url &&
|
|
194
|
+
Browser.extensionOrigin(action.url.trim())
|
|
195
|
+
)
|
|
196
|
+
return Browser.extensionPageRefusal(action.url.trim())
|
|
197
|
+
|
|
198
|
+
if (leaving.includes(action.type) || (!Browser.extensionOrigin(page.url) && !Browser.extensionOrigin(page.origin)))
|
|
199
|
+
return
|
|
200
|
+
|
|
201
|
+
return `This tab shows an extension page (${page.url}). Agent browser tools cannot read or act on extension pages, because they run with that extension's privileges. Navigate this tab to a web page, or use another tab.`
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type FrameTree = {
|
|
205
|
+
readonly frame: {
|
|
206
|
+
readonly id: string
|
|
207
|
+
readonly parentId?: string
|
|
208
|
+
readonly url: string
|
|
209
|
+
readonly name?: string
|
|
210
|
+
readonly securityOrigin?: string
|
|
211
|
+
}
|
|
212
|
+
readonly childFrames?: ReadonlyArray<FrameTree>
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Documents which may receive agent input. Opaque web documents still need an allowed ancestry. */
|
|
216
|
+
export function inputDocument(url: string, origin: string) {
|
|
217
|
+
if (Browser.extensionOrigin(origin) || Browser.extensionOrigin(url)) return false
|
|
218
|
+
|
|
219
|
+
return /^(?:https?:\/\/|oc-preview:\/\/|file:\/\/|about:(?:blank|srcdoc)(?:[?#]|$)|data:|blob:(?:https?:\/\/|null\/|oc-preview:\/\/))/.test(
|
|
220
|
+
url,
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
type FrameTrees = {
|
|
225
|
+
/** The main frame's tree. */
|
|
226
|
+
readonly root: FrameTree
|
|
227
|
+
/** Each out-of-process frame's tree, under the frame that holds it. */
|
|
228
|
+
readonly children: ReadonlyArray<{ readonly parentID: string; readonly tree: FrameTree }>
|
|
229
|
+
/**
|
|
230
|
+
* Frames excluded by target or context, including every frame in an excluded target's tree.
|
|
231
|
+
*/
|
|
232
|
+
readonly extensions: ReadonlySet<string>
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** An excluded target contributes only frame IDs, never names, URLs, contexts or agent targets. */
|
|
236
|
+
export function excludedFrames(known: Iterable<string>, trees: readonly FrameTree[]) {
|
|
237
|
+
const ids = new Set(known)
|
|
238
|
+
|
|
239
|
+
const visit = (tree: FrameTree) => {
|
|
240
|
+
ids.add(tree.frame.id)
|
|
241
|
+
tree.childFrames?.forEach(visit)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
trees.forEach(visit)
|
|
245
|
+
|
|
246
|
+
return ids
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
type AgentFrameInfo = { id: string; parentID?: string; url: string; name: string }
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Every frame the trees name, in one walk, and what the agent may do with a frame ID: use it, or not, because the frame
|
|
253
|
+
* or one of its ancestors shows an extension's document, or because it hangs under no frame the trees name.
|
|
254
|
+
*/
|
|
255
|
+
function frameIndex(trees: FrameTrees) {
|
|
256
|
+
const frames = new Map<string, { info: AgentFrameInfo; extension: boolean; usable: boolean }>()
|
|
257
|
+
|
|
258
|
+
const walk = (tree: FrameTree, parentID?: string) => {
|
|
259
|
+
const parent = tree.frame.parentId || parentID
|
|
260
|
+
const id = tree.frame.id
|
|
261
|
+
|
|
262
|
+
if (!frames.has(id))
|
|
263
|
+
frames.set(id, {
|
|
264
|
+
info: parent
|
|
265
|
+
? { id, parentID: parent, url: tree.frame.url, name: tree.frame.name ?? "" }
|
|
266
|
+
: { id, url: tree.frame.url, name: tree.frame.name ?? "" },
|
|
267
|
+
usable: inputDocument(tree.frame.url, tree.frame.securityOrigin ?? ""),
|
|
268
|
+
extension:
|
|
269
|
+
trees.extensions.has(id) ||
|
|
270
|
+
Browser.extensionOrigin(tree.frame.url) ||
|
|
271
|
+
Browser.extensionOrigin(tree.frame.securityOrigin ?? ""),
|
|
272
|
+
})
|
|
273
|
+
tree.childFrames?.forEach((child) => walk(child, id))
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
walk(trees.root)
|
|
277
|
+
trees.children.forEach((child) => walk(child.tree, child.parentID))
|
|
278
|
+
|
|
279
|
+
const access = (frameID: string): "frame" | "extension" | "unavailable" => {
|
|
280
|
+
// Bounded by the number of frames, so a malformed tree with a cycle ends too.
|
|
281
|
+
for (let id = frameID, steps = 0; steps <= frames.size; steps++) {
|
|
282
|
+
const entry = frames.get(id)
|
|
283
|
+
|
|
284
|
+
if (trees.extensions.has(id) || entry?.extension) return "extension"
|
|
285
|
+
|
|
286
|
+
if (!entry?.usable) return "unavailable"
|
|
287
|
+
|
|
288
|
+
if (entry.info.parentID === undefined) return "frame"
|
|
289
|
+
id = entry.info.parentID
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return "unavailable"
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return { frames, access }
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* The tab's frames the agent may see and target: the main frame's tree, then each out-of-process frame's under its
|
|
300
|
+
* parent. A frame of an extension, such as a password manager's autofill overlay, is left out with every frame inside
|
|
301
|
+
* it, so the page around it stays usable while no frameID, ref or snapshot reaches into it.
|
|
302
|
+
*/
|
|
303
|
+
export function agentFrames(trees: FrameTrees) {
|
|
304
|
+
const index = frameIndex(trees)
|
|
305
|
+
|
|
306
|
+
return Array.from(index.frames.values(), (entry) => entry.info).filter((frame) => index.access(frame.id) === "frame")
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export type AgentFrameAccess =
|
|
310
|
+
| { type: "frame"; frame: AgentFrameInfo }
|
|
311
|
+
| { type: "extension"; message: string }
|
|
312
|
+
| { type: "unavailable"; message: string }
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* The frame an agent's `frameID` names, when the agent may use it. A frame that shows an extension's document, or
|
|
316
|
+
* sits inside one, is refused by name, so a call never quietly runs elsewhere.
|
|
317
|
+
*/
|
|
318
|
+
export function agentFrame(trees: FrameTrees, frameID: string): AgentFrameAccess {
|
|
319
|
+
const index = frameIndex(trees)
|
|
320
|
+
const access = index.access(frameID)
|
|
321
|
+
const frame = index.frames.get(frameID)?.info
|
|
322
|
+
|
|
323
|
+
if (access === "frame" && frame) return { type: "frame", frame }
|
|
324
|
+
|
|
325
|
+
if (access === "extension")
|
|
326
|
+
return {
|
|
327
|
+
type: "extension",
|
|
328
|
+
message: `Agent browser tools cannot use extension frames: frame ${frameID} shows an extension's document, which runs with that extension's privileges. Omit frameID to use the page around it, or use another frame from browser.frames({tabID}).`,
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
type: "unavailable",
|
|
333
|
+
message:
|
|
334
|
+
"Frame is unavailable. Call browser.frames({tabID}) and use a current frameID from this tab; omit frameID for the main frame.",
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export type Policy = {
|
|
339
|
+
readonly fileRoots?: ReadonlyArray<string>
|
|
340
|
+
readonly extensions?: ReadonlyArray<string>
|
|
341
|
+
readonly home?: string
|
|
342
|
+
readonly remote?: string
|
|
343
|
+
readonly artifacts?: boolean
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function allowedDestination(input: string, policy?: Policy) {
|
|
347
|
+
return (
|
|
348
|
+
!!destinationOrigin(input) ||
|
|
349
|
+
fileURLWithin(input, policy?.fileRoots ?? []) ||
|
|
350
|
+
extensionURL(input, policy?.extensions ?? [])
|
|
351
|
+
)
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export function normalizeURL(input: string, policy?: Policy) {
|
|
355
|
+
const url = withScheme(input, policy)
|
|
356
|
+
const reason = refusal(url, policy)
|
|
357
|
+
|
|
358
|
+
if (reason === "browser.address.credentials")
|
|
359
|
+
throw new Error("URLs with a user name or password are not supported. Remove them from the URL.")
|
|
360
|
+
|
|
361
|
+
if (reason)
|
|
362
|
+
throw new Error(
|
|
363
|
+
policy?.fileRoots?.length || policy?.remote
|
|
364
|
+
? "Only HTTP, HTTPS, about:blank, and file URLs inside the workspace are supported."
|
|
365
|
+
: "Only HTTP, HTTPS, and about:blank URLs are supported.",
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
return url
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** A saved address is evidence for the address bar, not authority to reopen a file after a session move. */
|
|
372
|
+
export function restoreRefusal(url: string, policy: Policy) {
|
|
373
|
+
if (!refusal(url, policy)) return
|
|
374
|
+
|
|
375
|
+
return /^(?:file|workspace):/i.test(url) ? "browser.restore.outside" : "browser.restore.refused"
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Why the pane does not open an address, as the code the window explains it with; undefined when it opens.
|
|
380
|
+
* - `browser.address.credentials`: a web page address with a user name or password.
|
|
381
|
+
* - `browser.address.workspace`: anything but a web page or a file in the workspace.
|
|
382
|
+
* - `browser.address.web`: anything but a web page, where no files open.
|
|
383
|
+
*/
|
|
384
|
+
export function refusal(input: string, policy?: Policy) {
|
|
385
|
+
const url = withScheme(input, policy)
|
|
386
|
+
|
|
387
|
+
if (
|
|
388
|
+
url === "about:blank" ||
|
|
389
|
+
allowedDestination(url, policy) ||
|
|
390
|
+
(policy?.artifacts && artifactAddress(url)) ||
|
|
391
|
+
(policy?.remote && remotePath(url, policy.remote))
|
|
392
|
+
)
|
|
393
|
+
return
|
|
394
|
+
|
|
395
|
+
// A web page is refused only for its credentials.
|
|
396
|
+
if (URL.canParse(url) && /^https?:$/.test(new URL(url).protocol)) return "browser.address.credentials"
|
|
397
|
+
|
|
398
|
+
return policy?.fileRoots?.length || policy?.remote ? "browser.address.workspace" : "browser.address.web"
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// The URL an address opens: a blank page for none, else the address with a scheme, `http` for this machine's names.
|
|
402
|
+
export function localAddress(value: string) {
|
|
403
|
+
return /^(?:file:|[a-z]:[\\/]|\\\\|~[\\/]|\.{1,2}[\\/]|\/(?!\/[^/\\]))/i.test(value)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function withScheme(input: string, policy?: Policy) {
|
|
407
|
+
const value = input.trim()
|
|
408
|
+
|
|
409
|
+
if (!value || /^about:blank$/i.test(value)) return "about:blank"
|
|
410
|
+
|
|
411
|
+
if (localAddress(value)) {
|
|
412
|
+
if (/^file:/i.test(value)) return localFileURL(value) ?? value
|
|
413
|
+
|
|
414
|
+
// Never resolve a UNC path on the network, even to check whether it exists.
|
|
415
|
+
if (value.startsWith("\\\\")) return value
|
|
416
|
+
const relative = /^(~|\.{1,2})[\\/]/.exec(value)
|
|
417
|
+
const base = relative?.[1] === "~" ? policy?.home : policy?.fileRoots?.[0]
|
|
418
|
+
|
|
419
|
+
if (relative && !base) return value
|
|
420
|
+
const path = relative ? `${base}/${relative[1] === "~" ? value.slice(2) : value}` : value
|
|
421
|
+
|
|
422
|
+
return new URL(`file://${encodeFilePath(path)}`).href
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (value.startsWith("//")) return `https:${value}`
|
|
426
|
+
|
|
427
|
+
if (/^[a-z][a-z\d+.-]*:\/\//i.test(value)) return value
|
|
428
|
+
|
|
429
|
+
return `${Browser.loopbackAddress(value) ? "http" : "https"}://${value}`
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Electron rejects `loadURL` with ERR_FAILED (-2) whenever loading stops before `did-finish-load`. Chromium's media
|
|
434
|
+
* viewer for a video or audio URL commits its document and stops that way, so a committed navigation has loaded. A
|
|
435
|
+
* download never commits, so it still fails.
|
|
436
|
+
*/
|
|
437
|
+
export function committedLoad(error: Error, committed: boolean) {
|
|
438
|
+
return committed && "errno" in error && error.errno === -2
|
|
439
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { previewScheme } from "./scheme"
|
|
2
|
+
import { fileURLWithin, localFileURL } from "./policy"
|
|
3
|
+
import { remotePath } from "./remote-address"
|
|
4
|
+
|
|
5
|
+
/** A file: address is for display and restore only. Never hand Chromium a native file origin, even briefly. */
|
|
6
|
+
export function previewAddress(address: string, host: string | undefined, roots: readonly string[], remote?: string) {
|
|
7
|
+
if (remote) return host && remotePath(address, remote) ? `${previewScheme}://${host}/${address.slice(remote.length)}` : undefined
|
|
8
|
+
const file = localFileURL(address)
|
|
9
|
+
|
|
10
|
+
if (!file || !host || !fileURLWithin(file, roots)) return
|
|
11
|
+
|
|
12
|
+
return `${previewScheme}://${host}${file.slice("file://".length)}`
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function previewFile(address: string, host: string | undefined, roots: readonly string[], remote?: string) {
|
|
16
|
+
const prefix = `${previewScheme}://${host}/`
|
|
17
|
+
|
|
18
|
+
if (!host || !address.startsWith(prefix) || address.startsWith(`${prefix}/`) || address.split(/[?#]/, 1)[0]?.includes("\\")) return
|
|
19
|
+
|
|
20
|
+
if (remote) return remotePath(address, prefix) ? `${remote}${address.slice(prefix.length)}` : undefined
|
|
21
|
+
|
|
22
|
+
const file = `file:///${address.slice(prefix.length)}`
|
|
23
|
+
|
|
24
|
+
return fileURLWithin(file, roots) && !new URL(file).pathname.endsWith("/") ? file : undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** The browser may open a preview; only that preview's origin may request its resources, including from a worker. */
|
|
28
|
+
export function previewResource(address: string, host: string, initiator: string | undefined, roots: readonly string[]) {
|
|
29
|
+
if (initiator !== undefined && initiator !== `${previewScheme}://${host}`) return
|
|
30
|
+
|
|
31
|
+
return previewFile(address, host, roots)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A History API route without a corresponding file keeps the last validated address in the bar. Reload that file. */
|
|
35
|
+
export function reloadAddress(actual: string, shown: string, host: string | undefined, roots: readonly string[], remote?: string) {
|
|
36
|
+
if (!host || !actual.startsWith(`${previewScheme}://${host}/`)) return
|
|
37
|
+
const destination = previewAddress(shown, host, roots, remote)
|
|
38
|
+
|
|
39
|
+
return destination && destination !== actual ? shown : undefined
|
|
40
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { createDecipheriv, createHash, pbkdf2Sync } from "node:crypto"
|
|
2
|
+
import { chromiumTime, type CookieRead, type ImportedCookie } from "./cookie"
|
|
3
|
+
import { snapshotDatabase, type SnapshotScratch } from "./database"
|
|
4
|
+
import type { CookieHost } from "./sites"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The key a Chromium profile encrypts cookie values with.
|
|
8
|
+
* - `gcm`: Windows. AES-256-GCM, unwrapped from `Local State` with DPAPI.
|
|
9
|
+
* - `cbc`: macOS and Linux. AES-128-CBC keys derived from the Safe Storage password; `v11` only where a keyring holds one.
|
|
10
|
+
*/
|
|
11
|
+
export type ChromiumKey =
|
|
12
|
+
| { readonly type: "gcm"; readonly key: Uint8Array }
|
|
13
|
+
| { readonly type: "cbc"; readonly v10: Uint8Array; readonly v11: Uint8Array | undefined }
|
|
14
|
+
|
|
15
|
+
/** A Chromium cookie value: decrypted text, or why it has none. */
|
|
16
|
+
export type Decrypted = { readonly value: string } | { readonly error: "protected" | "failed" }
|
|
17
|
+
|
|
18
|
+
/** The AES-128 key Chromium derives from a Safe Storage password: 1003 PBKDF2 rounds on macOS, 1 on Linux. */
|
|
19
|
+
export function deriveCbcKey(password: string, iterations: number) {
|
|
20
|
+
return pbkdf2Sync(password, "saltysalt", iterations, 16, "sha1")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Decrypts one `encrypted_value`. Since cookie database version 24 the plain text starts with the SHA-256 of the
|
|
25
|
+
* cookie's host, which this strips. `v20` values use Chrome's app-bound encryption on Windows, which only the browser's
|
|
26
|
+
* own elevation service can unwrap.
|
|
27
|
+
*/
|
|
28
|
+
export function decryptChromium(encrypted: Uint8Array, key: ChromiumKey, host: string): Decrypted {
|
|
29
|
+
const buffer = Buffer.from(encrypted)
|
|
30
|
+
const version = buffer.subarray(0, 3).toString("latin1")
|
|
31
|
+
|
|
32
|
+
if (version === "v20") return { error: "protected" }
|
|
33
|
+
|
|
34
|
+
// A GCM value carries a 12-byte nonce and a 16-byte tag around its text.
|
|
35
|
+
if ((version !== "v10" && version !== "v11") || (key.type === "gcm" && buffer.length < 3 + 12 + 16))
|
|
36
|
+
return { error: "failed" }
|
|
37
|
+
const bytes = attempt(() => decipher(buffer, version, key))
|
|
38
|
+
|
|
39
|
+
if (!bytes) return { error: "failed" }
|
|
40
|
+
const digest = createHash("sha256").update(host).digest()
|
|
41
|
+
const text = bytes.length >= 32 && bytes.subarray(0, 32).equals(digest) ? bytes.subarray(32) : bytes
|
|
42
|
+
const value = attempt(() => new TextDecoder("utf-8", { fatal: true }).decode(text))
|
|
43
|
+
|
|
44
|
+
return value === undefined ? { error: "failed" } : { value }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function decipher(buffer: Buffer, version: "v10" | "v11", key: ChromiumKey) {
|
|
48
|
+
if (key.type === "gcm") {
|
|
49
|
+
const nonce = buffer.subarray(3, 15)
|
|
50
|
+
const body = buffer.subarray(15, -16)
|
|
51
|
+
const gcm = createDecipheriv("aes-256-gcm", key.key, nonce)
|
|
52
|
+
gcm.setAuthTag(buffer.subarray(-16))
|
|
53
|
+
|
|
54
|
+
return Buffer.concat([gcm.update(body), gcm.final()])
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const secret = version === "v11" ? key.v11 : key.v10
|
|
58
|
+
|
|
59
|
+
if (!secret) throw new Error("No key for this cookie version")
|
|
60
|
+
const cbc = createDecipheriv("aes-128-cbc", secret, Buffer.alloc(16, 0x20))
|
|
61
|
+
|
|
62
|
+
return Buffer.concat([cbc.update(buffer.subarray(3)), cbc.final()])
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// A wrong key or a corrupt value throws from the decipher or the UTF-8 decoder, which have no non-throwing form;
|
|
66
|
+
// either is one failed cookie.
|
|
67
|
+
function attempt<T>(run: () => T) {
|
|
68
|
+
try {
|
|
69
|
+
return run()
|
|
70
|
+
} catch {
|
|
71
|
+
return undefined
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** A cookie row whose every value has the type Chromium writes; a damaged row has another, which SQLite allows. */
|
|
76
|
+
const WELL_FORMED = [
|
|
77
|
+
"typeof(host_key) = 'text'",
|
|
78
|
+
"typeof(name) = 'text'",
|
|
79
|
+
"typeof(value) = 'text'",
|
|
80
|
+
"typeof(encrypted_value) = 'blob'",
|
|
81
|
+
"typeof(path) = 'text'",
|
|
82
|
+
...["expires_utc", "has_expires", "is_secure", "is_httponly", "samesite"].map((column) => `typeof(${column}) = 'integer'`),
|
|
83
|
+
"typeof(top_frame_site_key) IN ('text', 'null')",
|
|
84
|
+
].join(" AND ")
|
|
85
|
+
|
|
86
|
+
/** Chromium's `samesite` column, by value; -1 is unspecified. */
|
|
87
|
+
const SAME_SITE = ["no_restriction", "lax", "strict"] as const
|
|
88
|
+
|
|
89
|
+
type Row = {
|
|
90
|
+
host_key: string
|
|
91
|
+
name: string
|
|
92
|
+
value: string
|
|
93
|
+
encrypted_value: Uint8Array
|
|
94
|
+
path: string
|
|
95
|
+
expires_utc: number | bigint
|
|
96
|
+
has_expires: number | bigint
|
|
97
|
+
is_secure: number | bigint
|
|
98
|
+
is_httponly: number | bigint
|
|
99
|
+
samesite: number | bigint
|
|
100
|
+
top_frame_site_key: string | null
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The hosts of a Chromium profile's cookies that an import would write, for the list of its sites. It reads the
|
|
105
|
+
* plain-text columns only: no value is read, so nothing is decrypted and no key is asked for. Partitioned cookies
|
|
106
|
+
* stay out, as an import leaves them behind.
|
|
107
|
+
*/
|
|
108
|
+
export async function readChromiumHosts(database: string, scratch: SnapshotScratch): Promise<CookieHost[]> {
|
|
109
|
+
const rows = await snapshotDatabase(database, scratch, (db) => {
|
|
110
|
+
const query = db.prepare(
|
|
111
|
+
"SELECT host_key, expires_utc, has_expires, last_access_utc FROM cookies WHERE (top_frame_site_key IS NULL OR top_frame_site_key = '') AND typeof(host_key) = 'text'",
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
query.setReadBigInts(true)
|
|
115
|
+
|
|
116
|
+
// SAFETY: the query names Chromium's cookie table columns. SQLite types each value, so it keeps only rows whose
|
|
117
|
+
// host is text; a damaged row names no site. The rest are integers.
|
|
118
|
+
return query.all() as { host_key: string; expires_utc: bigint; has_expires: bigint; last_access_utc: bigint }[]
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
return rows.map((row) => ({
|
|
122
|
+
host: row.host_key,
|
|
123
|
+
expires: Number(row.has_expires) ? chromiumTime(row.expires_utc) : undefined,
|
|
124
|
+
used: chromiumTime(row.last_access_utc) ?? 0,
|
|
125
|
+
}))
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Reads a Chromium profile's cookie database from a copy, so the running browser keeps its lock. Partitioned cookies
|
|
130
|
+
* (CHIPS) stay behind: Electron cannot write a cookie's partition. With `keep`, only the rows of the hosts it keeps
|
|
131
|
+
* are decrypted and counted; the others are not read further.
|
|
132
|
+
*/
|
|
133
|
+
export async function readChromiumCookies(
|
|
134
|
+
database: string,
|
|
135
|
+
key: ChromiumKey,
|
|
136
|
+
scratch: SnapshotScratch,
|
|
137
|
+
keep?: (host: string) => boolean,
|
|
138
|
+
): Promise<CookieRead> {
|
|
139
|
+
const read = await snapshotDatabase(database, scratch, (db) => {
|
|
140
|
+
const query = db.prepare(
|
|
141
|
+
`SELECT host_key, name, value, encrypted_value, path, expires_utc, has_expires, is_secure, is_httponly, samesite, top_frame_site_key FROM cookies WHERE ${WELL_FORMED}`,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
// Damaged rows, by host where it is text, so an import of chosen sites counts only theirs.
|
|
145
|
+
const damaged = db.prepare(`SELECT CASE WHEN typeof(host_key) = 'text' THEN host_key END AS host FROM cookies WHERE NOT (${WELL_FORMED})`)
|
|
146
|
+
|
|
147
|
+
// Chromium's timestamps count microseconds since 1601, past the largest integer a number holds exactly.
|
|
148
|
+
query.setReadBigInts(true)
|
|
149
|
+
|
|
150
|
+
// SAFETY: the query names Chromium's cookie table columns and keeps only the rows whose values have the SQLite
|
|
151
|
+
// types `Row` says; the second one's `host` is text or null.
|
|
152
|
+
return { rows: query.all() as Row[], damaged: damaged.all() as { host: string | null }[] }
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
// A damaged row is one cookie that does not import, as one whose value does not decrypt; one whose host is not text
|
|
156
|
+
// names no site, so only an import of every site counts it.
|
|
157
|
+
const failed = read.damaged.filter((row) => (row.host === null ? !keep : !keep || keep(row.host))).length
|
|
158
|
+
|
|
159
|
+
return read.rows.reduce<{ cookies: ImportedCookie[]; protected: number; failed: number; skipped: number }>(
|
|
160
|
+
(result, row) => {
|
|
161
|
+
if (keep && !keep(row.host_key)) return result
|
|
162
|
+
|
|
163
|
+
if (row.top_frame_site_key) {
|
|
164
|
+
result.skipped++
|
|
165
|
+
|
|
166
|
+
return result
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const decrypted = rowValue(row, key)
|
|
170
|
+
|
|
171
|
+
if ("error" in decrypted) {
|
|
172
|
+
result[decrypted.error]++
|
|
173
|
+
|
|
174
|
+
return result
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
result.cookies.push({
|
|
178
|
+
host: row.host_key,
|
|
179
|
+
name: row.name,
|
|
180
|
+
value: decrypted.value,
|
|
181
|
+
path: row.path,
|
|
182
|
+
secure: !!Number(row.is_secure),
|
|
183
|
+
httpOnly: !!Number(row.is_httponly),
|
|
184
|
+
expires: Number(row.has_expires) ? chromiumTime(row.expires_utc) : undefined,
|
|
185
|
+
sameSite: SAME_SITE[Number(row.samesite)] ?? "unspecified",
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
return result
|
|
189
|
+
},
|
|
190
|
+
{ cookies: [], protected: 0, failed, skipped: 0 },
|
|
191
|
+
)
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function rowValue(row: Row, key: ChromiumKey): Decrypted {
|
|
195
|
+
if (row.value || !row.encrypted_value.length) return { value: row.value }
|
|
196
|
+
|
|
197
|
+
return decryptChromium(row.encrypted_value, key, row.host_key)
|
|
198
|
+
}
|