sliccy 6.103.0 → 6.104.0
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/README.md +3 -1
- package/dist/node-server/_shared/base64.d.ts +20 -4
- package/dist/node-server/_shared/base64.d.ts.map +1 -1
- package/dist/node-server/_shared/base64.js +54 -16
- package/dist/node-server/_shared/base64.js.map +1 -1
- package/dist/ui/.vite/manifest.json +244 -244
- package/dist/ui/assets/SKILL-B-2ojpz4.js +1 -0
- package/dist/ui/assets/{account-store-CYDvIaVu.js → account-store-BmJKIPqf.js} +3 -3
- package/dist/ui/assets/{account-store-2HXGXOYw.js → account-store-IiqFvQxF.js} +2 -2
- package/dist/ui/assets/{adobe-Cxnjdp-b.js → adobe-ENkhvelX.js} +2 -2
- package/dist/ui/assets/{adobe-CHrMcyJR.js → adobe-V7ngPPFB.js} +1 -1
- package/dist/ui/assets/{agent-message-to-chat-LqFvUGRI.js → agent-message-to-chat-CjWIKGH-.js} +1 -1
- package/dist/ui/assets/{agent-panels-CQMn613l.js → agent-panels-D8HPvbSm.js} +1 -1
- package/dist/ui/assets/{apply-layout-CKPvqJ72.js → apply-layout-CT5ajQg2.js} +1 -1
- package/dist/ui/assets/{apps-D2Okb4k7.js → apps-C2-yNti0.js} +1 -1
- package/dist/ui/assets/{azure-openai-1aocb0H-.js → azure-openai-D6U381kS.js} +1 -1
- package/dist/ui/assets/{azure-openai-BuMIS7Bh.js → azure-openai-dxPSwxHX.js} +1 -1
- package/dist/ui/assets/base64-DJRlyqZu.js +1 -0
- package/dist/ui/assets/base64-DzRgusa4.js +1 -0
- package/dist/ui/assets/{cerebras-DXr-x7LQ.js → cerebras-CJG0lmgZ.js} +1 -1
- package/dist/ui/assets/{cerebras-BuoMzGgu.js → cerebras-DMAP0cNO.js} +1 -1
- package/dist/ui/assets/{client-DVC0x03n.js → client-Beg9O208.js} +1 -1
- package/dist/ui/assets/{composer-speech-Byuwd2QJ.js → composer-speech-C08Pruqj.js} +1 -1
- package/dist/ui/assets/{connect-surface-GtTP-1_-.js → connect-surface-DmxJIbHQ.js} +1 -1
- package/dist/ui/assets/{derive-Do9C10kj.js → derive-D0xHQ8be.js} +1 -1
- package/dist/ui/assets/{discovery-preference-__0HPYJC.js → discovery-preference-cJij_YcT.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-Hv5Jwof_.js → ensure-speech-assets-CmarhXRU.js} +1 -1
- package/dist/ui/assets/{float-topology-DiK91BlA.js → float-topology-BYb7rxY5.js} +1 -1
- package/dist/ui/assets/{follower-navigate-watcher-DRFF6ll0.js → follower-navigate-watcher-BoAzVfrf.js} +1 -1
- package/dist/ui/assets/{fs-DXCuzgSg.js → fs-jddXs9y2.js} +2 -2
- package/dist/ui/assets/{fs-C3c6w9-a.js → fs-m1HwXJLG.js} +1 -1
- package/dist/ui/assets/{github-BLj7VHTt.js → github-BljExxxl.js} +1 -1
- package/dist/ui/assets/{github-BnuhP2-n.js → github-Do8ICJHI.js} +2 -2
- package/dist/ui/assets/{github-copilot-CYUxLKSB.js → github-copilot-B1tRU69x.js} +1 -1
- package/dist/ui/assets/{github-copilot-BXoJbpP6.js → github-copilot-D9oFUdvW.js} +1 -1
- package/dist/ui/assets/{github-install-BD6dt_G9.js → github-install-CUvUxsIv.js} +1 -1
- package/dist/ui/assets/{github-zip-B02OE0Yl.js → github-zip-Bs6pXdFH.js} +1 -1
- package/dist/ui/assets/{hear-zfLnACrB.js → hear-Du8SABf8.js} +1 -1
- package/dist/ui/assets/image-markers-CxJ9ZBgw.js +1 -0
- package/dist/ui/assets/image-markers-D3wDAnBQ.js +1 -0
- package/dist/ui/assets/{js-realm-worker-PKhqt2dx.js → js-realm-worker-DSes0sDh.js} +1 -1
- package/dist/ui/assets/{kernel-worker-D63pfX5V.js → kernel-worker-B28TODxd.js} +653 -659
- package/dist/ui/assets/{lick-urls-DcXOqXGm.js → lick-urls-51I5JBZv.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-CnkYvHKI.js → lick-ws-bridge-BJTVP6Z3.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-CdCpPLQn.js → lick-ws-bridge-rxCk9AYw.js} +1 -1
- package/dist/ui/assets/{local-llm-diVugIpU.js → local-llm-BpWVG7rb.js} +1 -1
- package/dist/ui/assets/{local-llm-ChjdFyYM.js → local-llm-DOlE_mq0.js} +1 -1
- package/dist/ui/assets/{main-C5AdMvBs.js → main-BtqcEAf5.js} +3 -3
- package/dist/ui/assets/{mime-types-ugOWOUZ9.js → mime-types-k2E6ulyv.js} +1 -1
- package/dist/ui/assets/mount-BkpFTojV.js +1 -0
- package/dist/ui/assets/mount-Dd5dDOL5.js +2 -0
- package/dist/ui/assets/{mount-bridge-client-DZE6sHdr.js → mount-bridge-client-BJeJ5p60.js} +1 -1
- package/dist/ui/assets/{mount-recovery-kHgQPTiP.js → mount-recovery-Guc6Q7BU.js} +1 -1
- package/dist/ui/assets/{new-session-CLDTP1Ha.js → new-session-BoQLo0jr.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-Q4wu8L1N.js → oauth-bootstrap-Bn6ni8m6.js} +2 -2
- package/dist/ui/assets/{oauth-service-CTntqv0R.js → oauth-service-CUpgufjo.js} +1 -1
- package/dist/ui/assets/{oauth-service-Uk8UIb05.js → oauth-service-DJuzPXsg.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-BDPENm4z.js → onboarding-orchestrator-U8D_WgM3.js} +1 -1
- package/dist/ui/assets/{openai-codex-DzZQfBk5.js → openai-codex-BEG15TVt.js} +1 -1
- package/dist/ui/assets/{openai-codex-D6b0qLLD.js → openai-codex-D0bUPtBU.js} +1 -1
- package/dist/ui/assets/{openrouter-C1YZRCjk.js → openrouter-Cb6vTZpw.js} +1 -1
- package/dist/ui/assets/{openrouter-r_4mAy03.js → openrouter-Crh8YgQ9.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DDfoy5tV.js → openrouter-oauth-Ae456v76.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-1wD51O1n.js → openrouter-oauth-BJnOa1H0.js} +1 -1
- package/dist/ui/assets/{page-approval-service-BsXoPdFJ.js → page-approval-service-Z5cL8IlA.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-CvI3UzqY.js → panel-rpc-handlers-BIQygnJj.js} +2 -2
- package/dist/ui/assets/{panelize-shell-ooopfPDo.js → panelize-shell-B69-apOi.js} +3 -3
- package/dist/ui/assets/{port-bridge-client-BhmNRlRv.js → port-bridge-client-Cti-DmEY.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-Bz2N1tvn.js → port-bridge-client-D5ndzGCE.js} +1 -1
- package/dist/ui/assets/{provider-B6wQUVzw.js → provider-B77vujtm.js} +2 -2
- package/dist/ui/assets/{provider-Bjs--JSB.js → provider-BTCt1a5M.js} +1 -1
- package/dist/ui/assets/{provider-settings-BJNC5iLZ.js → provider-settings-CjRIHeBL.js} +1 -1
- package/dist/ui/assets/provider-store-access-BJuEQWzj.js +1 -0
- package/dist/ui/assets/provider-store-access-DwO-dyKc.js +1 -0
- package/dist/ui/assets/{providers-Cu3X40mC.js → providers-DSoO_C6K.js} +1 -1
- package/dist/ui/assets/{providers-JIVwDwZk.js → providers-FS2J0XfF.js} +2 -2
- package/dist/ui/assets/proxied-fetch-BduXImRw.js +1 -0
- package/dist/ui/assets/proxied-fetch-CFWkfPNA.js +2 -0
- package/dist/ui/assets/{quick-llm-CArBV9V1.js → quick-llm-BkiH_6dY.js} +1 -1
- package/dist/ui/assets/{recovery-screen-DfmBaRa7.js → recovery-screen-D1QyEOdx.js} +1 -1
- package/dist/ui/assets/{redirect-uri-BPQVK-PM.js → redirect-uri-DlDnQlQH.js} +1 -1
- package/dist/ui/assets/run-8gbia05d.js +81 -0
- package/dist/ui/assets/{secret-env-CjwX7z7b.js → secret-env-Hwyj0iR1.js} +1 -1
- package/dist/ui/assets/secret-topology-BE7Eyd3P.js +1 -0
- package/dist/ui/assets/{secrets-bridge-client-DCQ44RyR.js → secrets-bridge-client-CHZomqvU.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-DKlJoNwI.js → setup-feature-flags-remote-KiV_vpC_.js} +1 -1
- package/dist/ui/assets/shared-2T6O01rS.js +1 -0
- package/dist/ui/assets/sidecar-repair-Bc7f-qAI.js +1 -0
- package/dist/ui/assets/{skills-5Rwu9u2J.js → skills-BSLkuDhj.js} +1 -1
- package/dist/ui/assets/slicc-version-CffU1Fgw.js +1 -0
- package/dist/ui/assets/{speak-BsVaFA0Z.js → speak-DW89OFqf.js} +1 -1
- package/dist/ui/assets/{sprinkle-bridge-e00Na2NA.js → sprinkle-bridge-D4YmJlZ6.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-BqdBktzt.js → sprinkle-manager-DAE09Bc2.js} +1 -1
- package/dist/ui/assets/state-wjrFrzRJ.js +42 -0
- package/dist/ui/assets/{store-Bk60qy3q.js → store-C_vXBvA7.js} +1 -1
- package/dist/ui/assets/{store-CcotY5td.js → store-DMAUhVMh.js} +1 -1
- package/dist/ui/assets/{sudo-C2uQCGwW.js → sudo-uUM_PEW2.js} +1 -1
- package/dist/ui/assets/{sync-dialog-bS8BMYIL.js → sync-dialog-B1Zaj4wJ.js} +1 -1
- package/dist/ui/assets/{transformers-env-_JNZLFlo.js → transformers-env-plTpP5Zy.js} +1 -1
- package/dist/ui/assets/{tray-leader-Mq6HIneb.js → tray-leader-B_FxjW0d.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-CN7V9V7O.js → tray-leave-runtime-3_wlFPFU.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-D7cmCcHJ.js → tray-runtime-config-Bpo7AZhY.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-CVoPQrT2.js → tray-runtime-config-Dv3NVv5v.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-BKMvHwKf.js → upgrade-detection-BZydnliA.js} +1 -1
- package/dist/ui/assets/{voice-reply-C8UI0Ce8.js → voice-reply-CX6bFYcn.js} +1 -1
- package/dist/ui/assets/wc-attach-BkTbG_ly.js +13 -0
- package/dist/ui/assets/{wc-extension-C_tUrkba.js → wc-extension-E7Frt2oB.js} +2 -2
- package/dist/ui/assets/wc-float-label-BFAB8N7T.js +1 -0
- package/dist/ui/assets/{wc-floatbar-online-hDMwVEXN.js → wc-floatbar-online-8LtSd2qH.js} +1 -1
- package/dist/ui/assets/wc-follower-CiI-JkaB.js +17 -0
- package/dist/ui/assets/wc-follower-oauth-DFGxpDk0.js +5 -0
- package/dist/ui/assets/wc-live-D2AOU6cb.js +399 -0
- package/dist/ui/assets/wc-nav-DsTH8Xrh.js +2 -0
- package/dist/ui/assets/{wc-onboarding-Cjhf5ixM.js → wc-onboarding-Df_du4AO.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-IZUYwkqB.js → wc-placeholder-DGci87zI.js} +3 -3
- package/dist/ui/assets/{wc-settings-BqCG_1e-.js → wc-settings-BOiDVH-h.js} +3 -3
- package/dist/ui/assets/{wc-shell-DvC3EILT.js → wc-shell-BNnCLD-w.js} +234 -192
- package/dist/ui/assets/{wc-shortcut-config-CqO0bcS1.js → wc-shortcut-config-Dc4NhmIf.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-CK7mLngw.js → wc-sprinkles-BD2yq34b.js} +2 -2
- package/dist/ui/assets/wc-transcript-export-BD-MB_QD.js +2 -0
- package/dist/ui/assets/wc-tray-B5valYx5.js +2 -0
- package/dist/ui/assets/welcome-detection-B8IanYtP.js +1 -0
- package/dist/ui/assets/{whisper-session-Ba-J0yyJ.js → whisper-session-B1agEx3i.js} +2 -2
- package/dist/ui/assets/{xai-grok-ZlLBti1J.js → xai-grok-CB2eT78f.js} +1 -1
- package/dist/ui/assets/{xai-grok-DTdMI5a9.js → xai-grok-hlQX59AH.js} +1 -1
- package/dist/ui/index.html +11 -11
- package/dist/ui/llm-proxy-sw.js +1 -1
- package/dist/ui/packages/webapp/index.html +11 -11
- package/package.json +6 -5
- package/dist/ui/assets/SKILL-DLXzwsY4.js +0 -1
- package/dist/ui/assets/attachments-CByeG2Ru.js +0 -1
- package/dist/ui/assets/base64-DpPqYZJF.js +0 -1
- package/dist/ui/assets/image-markers-BXtVm4og.js +0 -1
- package/dist/ui/assets/image-markers-CdcIBWOf.js +0 -1
- package/dist/ui/assets/mount-CpogDGkb.js +0 -2
- package/dist/ui/assets/mount-DpIXrEDK.js +0 -1
- package/dist/ui/assets/provider-store-access-DVAREFJY.js +0 -1
- package/dist/ui/assets/provider-store-access-Dz6h3snO.js +0 -1
- package/dist/ui/assets/proxied-fetch-BGeNrvQ4.js +0 -2
- package/dist/ui/assets/proxied-fetch-Co-pb0x0.js +0 -1
- package/dist/ui/assets/run-ox9f-UA4.js +0 -81
- package/dist/ui/assets/secret-topology-0AWfFTh5.js +0 -1
- package/dist/ui/assets/shared-B9N4MZd0.js +0 -1
- package/dist/ui/assets/sidecar-repair-BnFmspwN.js +0 -1
- package/dist/ui/assets/slicc-version-CYVS1TNs.js +0 -1
- package/dist/ui/assets/state-iYgYrNhF.js +0 -42
- package/dist/ui/assets/wc-attach-DWUyd7Z7.js +0 -13
- package/dist/ui/assets/wc-float-label-BoQtQSKG.js +0 -1
- package/dist/ui/assets/wc-follower-C8xn5naI.js +0 -17
- package/dist/ui/assets/wc-follower-oauth-DnEDcXHB.js +0 -5
- package/dist/ui/assets/wc-live-8-VP4Bs8.js +0 -399
- package/dist/ui/assets/wc-nav-CdVB38ne.js +0 -2
- package/dist/ui/assets/wc-transcript-export-DwjzNi7q.js +0 -2
- package/dist/ui/assets/wc-tray-l9Pd1LLv.js +0 -2
- package/dist/ui/assets/welcome-detection-CGlwAABD.js +0 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-BtqcEAf5.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-Czpn1I53.js">
|
|
@@ -18,27 +18,27 @@
|
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/libesm-BypnjKEL.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/logger-DDBAeTLF.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/src-CAWTvdAa.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/base64-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/base64-DJRlyqZu.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/runtime-env-Dlaokqg1.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/fetch-body-D2PwksUW.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/api-endpoint-GRCyib6X.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/proxied-fetch-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/proxied-fetch-CFWkfPNA.js">
|
|
26
26
|
<link rel="modulepreload" crossorigin href="/assets/runtime-env-E-i2SW1s.js">
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/float-topology-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/secret-topology-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/port-bridge-client-
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/image-markers-
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/float-topology-BYb7rxY5.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/secret-topology-BE7Eyd3P.js">
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/port-bridge-client-Cti-DmEY.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-CHZomqvU.js">
|
|
31
|
+
<link rel="modulepreload" crossorigin href="/assets/image-markers-CxJ9ZBgw.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/tool-ui-DfXu6quJ.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/providers-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/providers-FS2J0XfF.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/panel-rpc-B3MSVImO.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-compat-CgBMwna8.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/account-store-
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/account-store-BmJKIPqf.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/runtime-env-CgsZ7LTp.js">
|
|
38
38
|
<link rel="modulepreload" crossorigin href="/assets/telemetry-BVzuNdvW.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/messages-BD4p8GuF.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/assets/feature-flags-ByMXaIc4.js">
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/assets/tray-runtime-config-
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/assets/tray-runtime-config-Bpo7AZhY.js">
|
|
42
42
|
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BAjnN7Ar.js">
|
|
43
43
|
<link rel="modulepreload" crossorigin href="/assets/clipboard-eqmn97SP.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="/assets/tray-join-url-BIvzbiFR.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sliccy",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.104.0",
|
|
4
4
|
"description": "Browser-based coding agent with thin CLI server",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"packages/swift-launcher",
|
|
37
37
|
"packages/swift-traysession",
|
|
38
38
|
"packages/swift-traykit",
|
|
39
|
+
"packages/swift-widgetkit",
|
|
39
40
|
"packages/swift-server",
|
|
40
41
|
"packages/swift-optel"
|
|
41
42
|
],
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"dev:extension:fresh": "CDP_PORT=9333 bash packages/dev-tools/tools/dev-extension-fresh.sh",
|
|
48
49
|
"dev:electron:node:fresh": "PORT=5730 CDP_PORT=9225 bash packages/dev-tools/tools/dev-electron-node-fresh.sh",
|
|
49
50
|
"dev:electron:swift:fresh": "PORT=5740 CDP_PORT=9226 bash packages/dev-tools/tools/dev-electron-swift-fresh.sh",
|
|
50
|
-
"build": "npm run build -w @slicc/shared-ts && npm run build -w @slicc/cloud-core && npm run build -w @ai-ecoverse/spoon && npm run build -w @slicc/webcomponents && npm run build -w @slicc/webapp && npm run build -w @ai-ecoverse/cherry && npm run build -w @slicc/node-server && npm run build -w @slicc/chrome-extension && npm run build -w @slicc/cloudflare-worker && npm run build -w @slicc/swift-server && npm run build -w @slicc/swift-optel && npm run build -w @slicc/swift-traysession && npm run build -w @slicc/swift-traykit && npm run build -w @slicc/swift-launcher",
|
|
51
|
+
"build": "npm run build -w @slicc/shared-ts && npm run build -w @slicc/cloud-core && npm run build -w @ai-ecoverse/spoon && npm run build -w @slicc/webcomponents && npm run build -w @slicc/webapp && npm run build -w @ai-ecoverse/cherry && npm run build -w @slicc/node-server && npm run build -w @slicc/chrome-extension && npm run build -w @slicc/cloudflare-worker && npm run build -w @slicc/swift-server && npm run build -w @slicc/swift-optel && npm run build -w @slicc/swift-traysession && npm run build -w @slicc/swift-traykit && npm run build -w @slicc/swift-widgetkit && npm run build -w @slicc/swift-launcher",
|
|
51
52
|
"start": "node dist/node-server/index.js",
|
|
52
53
|
"start:electron": "node dist/node-server/index.js --electron",
|
|
53
54
|
"preflight": "node packages/dev-tools/tools/preflight-deps.mjs",
|
|
@@ -84,9 +85,9 @@
|
|
|
84
85
|
"lint:swift-deps": "node packages/dev-tools/tools/check-swift-unused-deps.mjs",
|
|
85
86
|
"lint:duplication": "jscpd --config jscpd.json --no-tips",
|
|
86
87
|
"lint:duplication:report": "jscpd --config jscpd.json --no-tips --threshold 100 --reporters console,html,json --output dist/jscpd",
|
|
87
|
-
"lint:swift": "npm run lint -w @slicc/swift-server && npm run lint -w @slicc/swift-optel && npm run lint -w @slicc/swift-traysession && npm run lint -w @slicc/swift-traykit && npm run lint -w @slicc/swift-launcher && cd packages/ios-app && swiftlint lint",
|
|
88
|
-
"lint:swift:format": "npm run lint:format -w @slicc/swift-server && npm run lint:format -w @slicc/swift-optel && npm run lint:format -w @slicc/swift-traysession && npm run lint:format -w @slicc/swift-traykit && npm run lint:format -w @slicc/swift-launcher && cd packages/ios-app && swift format lint --strict --parallel --recursive SliccFollower",
|
|
89
|
-
"format:swift": "npm run format -w @slicc/swift-server && npm run format -w @slicc/swift-optel && npm run format -w @slicc/swift-traysession && npm run format -w @slicc/swift-traykit && npm run format -w @slicc/swift-launcher && cd packages/ios-app && swift format --in-place --parallel --recursive SliccFollower",
|
|
88
|
+
"lint:swift": "npm run lint -w @slicc/swift-server && npm run lint -w @slicc/swift-optel && npm run lint -w @slicc/swift-traysession && npm run lint -w @slicc/swift-traykit && npm run lint -w @slicc/swift-widgetkit && npm run lint -w @slicc/swift-launcher && cd packages/ios-app && swiftlint lint",
|
|
89
|
+
"lint:swift:format": "npm run lint:format -w @slicc/swift-server && npm run lint:format -w @slicc/swift-optel && npm run lint:format -w @slicc/swift-traysession && npm run lint:format -w @slicc/swift-traykit && npm run lint:format -w @slicc/swift-widgetkit && npm run lint:format -w @slicc/swift-launcher && cd packages/ios-app && swift format lint --strict --parallel --recursive SliccFollower SliccWidgets",
|
|
90
|
+
"format:swift": "npm run format -w @slicc/swift-server && npm run format -w @slicc/swift-optel && npm run format -w @slicc/swift-traysession && npm run format -w @slicc/swift-traykit && npm run format -w @slicc/swift-widgetkit && npm run format -w @slicc/swift-launcher && cd packages/ios-app && swift format --in-place --parallel --recursive SliccFollower SliccWidgets",
|
|
90
91
|
"deadcode": "knip --include files,dependencies,devDependencies,unlisted,binaries,unresolved,duplicates",
|
|
91
92
|
"deadcode:full": "knip",
|
|
92
93
|
"deadcode:files": "knip --include files",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e='---\nname: automation\ndescription: |\n Use this when setting up event-driven automation in SLICC — webhooks, cron\n tasks, or filesystem watchers that route events to a scoop or cone. Covers\n `webhook`,\n `crontask`, and `fswatch` shell commands. Read this BEFORE wiring up anything\n that should fire on a schedule, an HTTP call, or a VFS change.\nallowed-tools: bash\n---\n\n# Automation: webhooks, cron, filesystem watchers\n\nSLICC\'s automation primitives turn external or VFS-internal events into **licks** — messages routed to a work unit. Three shell commands set them up:\n\n| Command | Trigger | Use case |\n| ---------- | ---------------------------- | --------------------------------- |\n| `webhook` | Inbound HTTP request | Callbacks from external services |\n| `crontask` | Cron schedule | Recurring background work |\n| `fswatch` | VFS create / modify / delete | React to authored content changes |\n\nAll three take `--scoop <target>`, which names **a unit, not a species**: a scoop name, a cone name, or a folder (`cone-<slug>`, `<name>-scoop`). Omit it and events come back to the cone you are in. A target naming no live unit is dropped, never re-routed.\n\n## `webhook`\n\nReceive HTTP callbacks. The lick carries the request method, path, headers, and body; `create` allocates a path and prints the URL.\n\n```bash\nwebhook create --scoop pr-watcher --name gh-prs\nwebhook create --scoop Research --name inbox # a cone, by name\nwebhook list && webhook delete wh-1\n```\n\nFlags:\n\n- `--scoop <target>` — scoop name, cone name, or folder. Required for webhooks.\n- `--name <label>` — label shown in `webhook list`.\n- `--filter <js>` — JS expression per request; falsy drops the event before the agent sees it.\n\n## `crontask`\n\nRun on a cron schedule. Standard 5-field cron (minute hour day month weekday).\n\n```bash\ncrontask create --cron "0 * * * *" --scoop hourly-summary --name hourly\ncrontask create --cron "0 9 * * *" --name digest # your own cone\ncrontask list && crontask delete ct-1 # `kill` is an alias for `delete`\n```\n\nFlags:\n\n- `--cron <expr>` — required; 5-field cron expression.\n- `--scoop <target>` — scoop name, cone name, or folder. Omit for your own cone.\n- `--name <label>` — label.\n- `--filter <js>` — JS expression evaluated each tick; falsy skips that fire.\n\n## `fswatch`\n\nWatch a VFS path; deliver a lick when a matching file is created, modified, or deleted.\n\n```bash\nfswatch create --path /workspace --pattern "*.md" --scoop doc-watcher --name md-changes\nfswatch create --path /workspace/src --pattern "*.ts" # your own cone\nfswatch list && fswatch delete fsw-1\n```\n\nEvents carry the change type (`create`, `modify`, `delete`) and the path.\n\n## Don\'t\n\n- Don\'t poll on a `crontask` for work the cone could do reactively. Cron is for genuinely recurring jobs (digests, refreshes); reactive work belongs on `fswatch`/`webhook`.\n- Don\'t leave watchers/webhooks/crons orphaned. If the owning unit is gone, the lick is dropped — `... list` and `... delete` to clean up.\n- Don\'t fan one trigger out to N near-identical entries. Register once, let the receiver dispatch.\n';export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n>=10||r===0?Math.round(n):Math.round(n*10)/10} ${t[r]}`}function t(t){let n=t.mimeType||`application/octet-stream`;return`${t.name} (${n}, ${e(t.size)})`}function n(e,t=`The original file lives on a remote runtime and is not accessible here.`){return e?.length?e.map(e=>{if(!e.path)return{...e};let{path:n,...r}=e;return e.kind===`image`&&e.data||e.kind===`text`&&e.text!==void 0?r:{...r,error:r.error??t}}):[]}export{n,t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=32768;function t(){return globalThis.Buffer}var n=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})?$/;function r(e){let r=t();if(r){if(!n.test(e))throw Error(`Invalid base64 string`);return new Uint8Array(r.from(e,`base64`))}let i=atob(e),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);return a}function i(n){let r=t();if(r)return r.from(n).toString(`base64`);let i=``;for(let t=0;t<n.byteLength;t+=e){let r=n.subarray(t,Math.min(t+e,n.byteLength));i+=String.fromCharCode.apply(null,r)}return btoa(i)}export{i as n,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]);function t(t){return e.has(t)}var n=String.raw`<img:data:image\/[^>]+>`,r=`<img:`,i=`;base64,`;function a(){return new RegExp(n,`g`)}function o(e){if(!e.startsWith(r)||!e.endsWith(`>`))return null;let t=e.slice(5,-1),n=t.indexOf(i);if(n<0)return null;let a=t.slice(5,n),o=t.slice(n+8);return!t.startsWith(`data:image/`)||a.length===6||a.includes(`;`)||!o?null:{dataUrl:t,mimeType:a,data:o}}function s(e){let t=e.replace(/[\t\n\f\r ]/g,``);if(!/^[A-Za-z0-9+/]+={0,2}$/.test(t))return null;let n=t.indexOf(`=`);return n>=0&&n<t.length-(t.endsWith(`==`)?2:1)||(n<0?t.length:n)%4==1||n>=0&&t.length%4!=0?null:t}function c(e){let n=[];for(let r of e.matchAll(a())){let e=r[0],i=r.index??0,a=o(e),c=a?s(a.data):null;if(!a||!c){n.push({kind:`inert`,marker:e,index:i,parsed:null});continue}let l={mimeType:a.mimeType,data:c,dataUrl:`data:${a.mimeType};base64,${c}`};n.push({kind:t(a.mimeType)?`image`:`unsupported`,marker:e,index:i,parsed:l})}return n}function l(e){let t=[],n=0;for(let r of c(e))r.kind!==`image`||!r.parsed||(r.index>n&&t.push({type:`text`,text:e.slice(n,r.index)}),t.push({type:`image`,marker:r.marker,...r.parsed}),n=r.index+r.marker.length);return(n<e.length||t.length===0)&&t.push({type:`text`,text:e.slice(n)}),t}export{l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]);function t(t){return e.has(t)}const n=String.raw`<img:data:image\/[^>]+>`;function r(){return new RegExp(n,`g`)}function i(e){if(!e.startsWith(`<img:`)||!e.endsWith(`>`))return null;let t=e.slice(5,-1),n=t.indexOf(`;base64,`);if(n<0)return null;let r=t.slice(5,n),i=t.slice(n+8);return!t.startsWith(`data:image/`)||r.length===6||r.includes(`;`)||!i?null:{dataUrl:t,mimeType:r,data:i}}function a(e){let t=e.replace(/[\t\n\f\r ]/g,``);if(!/^[A-Za-z0-9+/]+={0,2}$/.test(t))return null;let n=t.indexOf(`=`);return n>=0&&n<t.length-(t.endsWith(`==`)?2:1)||(n<0?t.length:n)%4==1||n>=0&&t.length%4!=0?null:t}function o(e){let n=[];for(let o of e.matchAll(r())){let e=o[0],r=o.index??0,s=i(e),c=s?a(s.data):null;if(!s||!c){n.push({kind:`inert`,marker:e,index:r,parsed:null});continue}let l={mimeType:s.mimeType,data:c,dataUrl:`data:${s.mimeType};base64,${c}`};n.push({kind:t(s.mimeType)?`image`:`unsupported`,marker:e,index:r,parsed:l})}return n}export{r as n,t as r,o as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/account-store-CYDvIaVu.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/preload-helper-Czpn1I53.js","assets/claude-model-version-C0HLsjny.js","assets/models-BSkXF4T6.js","assets/diagnostics-DN_idNHx.js","assets/provider-env-CTOcDKrQ.js","assets/__vite-browser-external-5eBdwsFd.js","assets/openrouter.models-BxrUfzom.js","assets/libesm-BypnjKEL.js","assets/logger-DDBAeTLF.js","assets/src-CAWTvdAa.js","assets/proxied-fetch-BGeNrvQ4.js","assets/base64-DpPqYZJF.js","assets/runtime-env-Dlaokqg1.js","assets/fetch-body-D2PwksUW.js","assets/api-endpoint-GRCyib6X.js","assets/float-topology-DiK91BlA.js","assets/runtime-env-E-i2SW1s.js","assets/secret-topology-0AWfFTh5.js","assets/secrets-bridge-client-DCQ44RyR.js","assets/port-bridge-client-BhmNRlRv.js","assets/image-markers-BXtVm4og.js","assets/tool-ui-DfXu6quJ.js","assets/providers-JIVwDwZk.js","assets/panel-rpc-B3MSVImO.js","assets/bedrock-camp-compat-CgBMwna8.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./preload-helper-Czpn1I53.js";import{t}from"./mime-types-ugOWOUZ9.js";import{n,t as r}from"./base64-DpPqYZJF.js";import"./src-CAWTvdAa.js";import{n as i}from"./runtime-env-Dlaokqg1.js";import{i as a,n as o,t as s}from"./api-endpoint-GRCyib6X.js";import"./runtime-env-E-i2SW1s.js";import{t as c}from"./types-idfTVsM8.js";import"./mount-table-store-dY2IfQ5S.js";import"./fs-DXCuzgSg.js";import{t as l}from"./mount-bridge-client-DZE6sHdr.js";var u=`https://api.aem.live`,d=`application/folder`,f=5242880;function p(e){let t=e.match(/^aem:\/\/([^/]+)\/([^/]+)(?:\/(.*))?$/);if(!t)throw Error(`invalid AEM source '${e}' — expected aem://org/site[/path]`);return{org:t[1],site:t[2],path:(t[3]??``).replace(/^\/+/,``).replace(/\/+$/,``)}}function m(e){if(!e)return``;let t=Date.parse(e);return Number.isNaN(t)?``:String(t)}function h(e){let t=Date.parse(e??``);return Number.isNaN(t)?0:t}function g(e){return e.map(e=>e[`content-type`]===d||e.name.endsWith(`/`)?{name:e.name.replace(/\/+$/,``),kind:`directory`}:{name:e.name,kind:`file`,size:e.size,etag:m(e[`last-modified`]),lastModified:h(e[`last-modified`])})}var _=class{kind=`aem`;source;profile;mountId;parsed;cache;maxBodyBytes;transport;closed=!1;constructor(e){this.source=e.source,this.profile=e.profile,this.mountId=e.mountId??crypto.randomUUID(),this.parsed=p(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??f,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new c(`EBADF`,`mount closed`,e)}toMountRelative(e){return e.replace(/^\/+/,``)}toSourcePath(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``),n=[this.parsed.path,t].filter(e=>e.length>0).join(`/`),r=`/${this.parsed.org}/sites/${this.parsed.site}/source`;return n?`${r}/${n}`:r}toListPath(e){return`${this.toSourcePath(e)}/`}request(e,t,n){return this.transport({method:e,path:t,origin:u,headers:n?.headers,body:n?.body})}async readFile(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n&&!this.cache.isStale(n.cachedAt))return n.body;let r=await this.request(`GET`,this.toSourcePath(t));if(r.status===404)throw await this.cache.invalidateBody(t),new c(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new c(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new c(`EIO`,`aem readFile failed: ${r.status}`,e);let i=new Uint8Array(await r.arrayBuffer());if(i.byteLength>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);return await this.cache.putBody(t,i,m(r.headers.get(`last-modified`))),i}async assertUnchanged(e,t,n){if(!n)return;let r=await this.request(`HEAD`,this.toSourcePath(t));if(r.status===404)return;if(r.status>=400)throw new c(`EIO`,`aem precondition HEAD failed: ${r.status}`,e);let i=m(r.headers.get(`last-modified`));if(i&&i!==n)throw await this.cache.invalidateBody(t),new c(`EBUSY`,`remote modified since last read — re-read and retry`,e)}async writeFile(e,t){if(this.assertOpen(e),t.byteLength>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);let n=this.toMountRelative(e),r=await this.cache.getBody(n);await this.assertUnchanged(e,n,r?.etag??``);let i=await this.request(`PUT`,this.toSourcePath(n),{body:t});if(i.status===401||i.status===403)throw new c(`EACCES`,`aem write denied`,e);if(i.status>=400)throw new c(`EIO`,`aem writeFile failed: ${i.status}`,e);await this.cache.invalidateBody(n);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a)}async readDir(e){this.assertOpen(e);let t=this.toMountRelative(e).replace(/\/+$/,``),n=await this.cache.getListing(t);if(n&&!this.cache.isStale(n.cachedAt))return n.entries;let r=await this.request(`GET`,this.toListPath(t));if(r.status===404)throw new c(`ENOENT`,`no such directory`,e);if(r.status===401||r.status===403)throw new c(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new c(`EIO`,`aem list failed: ${r.status}`,e);let i=g(await r.json());return await this.cache.putListing(t,i),i}async stat(e){this.assertOpen(e);let t=this.toMountRelative(e);if(t===``)return{kind:`directory`,size:0,mtime:0};let n=await this.cache.getBody(t);if(n)return{kind:`file`,size:n.size,mtime:n.cachedAt,etag:n.etag};let r=t.split(`/`),i=r.pop()??``,a=r.join(`/`),o=await this.cache.getListing(a),s=(o&&!this.cache.isStale(o.cachedAt)?o.entries:await this.readDirQuietly(a))?.find(e=>e.name===i);if(!s)throw new c(`ENOENT`,`no such file or directory`,e);return s.kind===`directory`?{kind:`directory`,size:0,mtime:s.lastModified??0}:{kind:`file`,size:s.size??0,mtime:s.lastModified??0,etag:s.etag??``}}async readDirQuietly(e){try{return await this.readDir(e)}catch{return null}}async mkdir(e){}async remove(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.request(`DELETE`,this.toSourcePath(t));if(n.status===404)throw new c(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new c(`EACCES`,`aem delete denied`,e);if(n.status>=400)throw new c(`EIO`,`aem delete failed: ${n.status}`,e);await this.cache.invalidateBody(t);let r=t.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(r)}async refresh(e){this.assertOpen(`/`);let t={added:[],removed:[],changed:[],unchanged:0,errors:[]},n=[``];for(;n.length>0;){let e=n.pop();try{await this.refreshDir(e,t,n)}catch(n){t.errors.push({path:e,message:n instanceof Error?n.message:String(n)})}}return e?.bodies&&await this.refreshBodies(t),t}async classifyFile(e,t,n){let r=await this.cache.getBody(e);r?t&&r.etag!==t?(await this.cache.invalidateBody(e),n.changed.push(e)):n.unchanged++:n.added.push(e)}async refreshDir(e,t,n){let r=await this.request(`GET`,this.toListPath(e));if(r.status===404){await this.cache.putListing(e,[]);return}if(r.status>=400){t.errors.push({path:e,message:`list failed: ${r.status}`});return}let i=g(await r.json());for(let r of i){let i=e?`${e}/${r.name}`:r.name;r.kind===`directory`?n.push(i):await this.classifyFile(i,r.etag??``,t)}await this.cache.putListing(e,i)}async refreshBodies(e){for(let t of e.changed)try{await this.readFile(t)}catch(n){e.errors.push({path:t,message:n instanceof Error?n.message:String(n)})}}describe(){return{displayName:`${this.parsed.org}/${this.parsed.site}${this.parsed.path?`/${this.parsed.path}`:``}`,source:this.source,profile:this.profile}}async close(){this.closed||=!0}};function v(e,t,n){let r=`----DaMount${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`,i=new TextEncoder,a=i.encode(`--${r}\r\nContent-Disposition: form-data; name="data"; filename="${e}"\r\nContent-Type: ${t}\r\n\r\n`),o=i.encode(`\r\n--${r}--\r\n`),s=new Uint8Array(a.byteLength+n.byteLength+o.byteLength);return s.set(a,0),s.set(n,a.byteLength),s.set(o,a.byteLength+n.byteLength),{contentType:`multipart/form-data; boundary=${r}`,body:s}}function y(e){return e.split(`/`).pop()||`data`}function b(e){let t=e.match(/^da:\/\/([^/]+)\/([^/]+)(?:\/(.*))?$/);if(!t)throw Error(`invalid DA source '${e}' — expected da://org/repo[/path]`);return{org:t[1],repo:t[2],path:(t[3]??``).replace(/^\/+/,``).replace(/\/+$/,``)}}var x=5242880,S=class{kind=`da`;source;profile;mountId;parsed;cache;maxBodyBytes;transport;closed=!1;constructor(e){this.source=e.source,this.profile=e.profile,this.mountId=e.mountId??crypto.randomUUID(),this.parsed=b(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??x,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new c(`EBADF`,`mount closed`,e)}toMountRelative(e){return e.replace(/^\/+/,``)}toSourcePath(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``),n=[this.parsed.path,t].filter(e=>e.length>0).join(`/`);return`/source/${this.parsed.org}/${this.parsed.repo}${n?`/${n}`:``}`}toListPath(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``),n=[this.parsed.path,t].filter(e=>e.length>0).join(`/`);return`/list/${this.parsed.org}/${this.parsed.repo}${n?`/${n}`:``}`}async readFile(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n&&!this.cache.isStale(n.cachedAt))return n.body;let r={};n&&(r[`if-none-match`]=n.etag);let i=await this.transport({method:`GET`,path:this.toSourcePath(t),headers:r});if(i.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(i.status===404)throw await this.cache.invalidateBody(t),new c(`ENOENT`,`no such file`,e);if(i.status===401||i.status===403)throw new c(`EACCES`,`da access denied`,e);if(i.status>=400)throw new c(`EIO`,`da readFile failed: ${i.status}`,e);let a=i.headers.get(`content-length`),o=a?Number(a):void 0;if(o!==void 0&&o>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);let s=new Uint8Array(await i.arrayBuffer());if(s.byteLength>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);let l=i.headers.get(`etag`)??``,u=l.startsWith(`W/`)?l.slice(2):l;return await this.cache.putBody(t,s,u),s}async writeFile(e,n){if(this.assertOpen(e),n.byteLength>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);let r=this.toMountRelative(e),i=await this.cache.getBody(r),a=v(y(e),t(e),n),o={"content-type":a.contentType,"content-length":String(a.body.byteLength)};i?.etag?o[`if-match`]=i.etag.startsWith(`W/`)?i.etag.slice(2):i.etag:i||(o[`if-none-match`]=`*`);let s=()=>this.transport({method:`POST`,path:this.toSourcePath(r),headers:o,body:a.body}),l,u=1;try{l=await s()}catch{u=2,l=await s()}if(l.status===412){if(u===2){let t=await this.transport({method:`HEAD`,path:this.toSourcePath(r)});if(t.status>=400)throw new c(`EIO`,`da reconcile HEAD failed: ${t.status}`,e);let i=t.headers.get(`etag`)??``;await this.cache.putBody(r,n,i);let a=r.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a);return}await this.cache.invalidateBody(r);try{await this.readFile(e)}catch{}throw new c(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(l.status===401||l.status===403)throw new c(`EACCES`,`da write denied`,e);if(l.status>=400)throw new c(`EIO`,`da writeFile failed: ${l.status}`,e);let d=l.headers.get(`etag`)??``;await this.cache.putBody(r,n,d);let f=r.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(f)}async readDir(e){this.assertOpen(e);let t=this.toMountRelative(e).replace(/\/+$/,``),n=await this.cache.getListing(t);if(n&&!this.cache.isStale(n.cachedAt))return n.entries;let r=await this.transport({method:`GET`,path:this.toListPath(t)});if(r.status===404)throw new c(`ENOENT`,`no such directory`,e);if(r.status>=400)throw new c(`EIO`,`da list failed: ${r.status}`,e);let i=(await r.json()).map(e=>e.ext?{name:`${e.name}.${e.ext}`,kind:`file`,etag:e.etag,lastModified:e.lastModified}:{name:e.name,kind:`directory`,lastModified:e.lastModified});return await this.cache.putListing(t,i),i}async stat(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n)return{kind:`file`,size:n.size,mtime:n.cachedAt,etag:n.etag};let r=t.split(`/`),i=r.pop()??``,a=r.join(`/`),o=await this.cache.getListing(a);if(o&&!this.cache.isStale(o.cachedAt)){let t=o.entries.find(e=>e.name===i);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??o.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??o.cachedAt};if(!t)throw new c(`ENOENT`,`no such file or directory`,e)}let s=await this.transport({method:`HEAD`,path:this.toSourcePath(t)});if(s.status===200){let e=Number(s.headers.get(`content-length`)??`0`),t=s.headers.get(`etag`)??``,n=s.headers.get(`last-modified`),r=n?Date.parse(n):0;if(o){let n=o.entries.map(n=>n.name===i&&n.kind===`file`?{...n,size:e,etag:t,lastModified:r}:n);await this.cache.putListing(a,n)}return{kind:`file`,size:e,mtime:r,etag:t}}if(s.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new c(`ENOENT`,`no such file or directory`,e)}throw new c(`EIO`,`da stat failed: ${s.status}`,e)}async mkdir(e){}async remove(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.transport({method:`DELETE`,path:this.toSourcePath(t)});if(n.status===404)throw new c(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new c(`EACCES`,`da delete denied`,e);if(n.status>=400)throw new c(`EIO`,`da delete failed: ${n.status}`,e);await this.cache.invalidateBody(t);let r=t.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(r)}async refresh(e){this.assertOpen(`/`);let t={added:[],removed:[],changed:[],unchanged:0,errors:[]},n=[``];for(;n.length>0;){let e=n.pop();try{await this.refreshDir(e,t,n)}catch(n){t.errors.push({path:e,message:n instanceof Error?n.message:String(n)})}}return e?.bodies&&await this.refreshBodies(t),t}async classifyFile(e,t,n){let r=await this.cache.getBody(e);r?t&&r.etag!==t?(await this.cache.invalidateBody(e),n.changed.push(e)):n.unchanged++:n.added.push(e)}async refreshDir(e,t,n){let r=await this.transport({method:`GET`,path:this.toListPath(e)});if(r.status>=400){t.errors.push({path:e,message:`list failed: ${r.status}`});return}let i=await r.json(),a=[];for(let r of i)if(r.ext){let n=e?`${e}/${r.name}.${r.ext}`:`${r.name}.${r.ext}`;a.push({name:`${r.name}.${r.ext}`,kind:`file`,etag:r.etag,lastModified:r.lastModified}),await this.classifyFile(n,r.etag,t)}else a.push({name:r.name,kind:`directory`}),n.push(e?`${e}/${r.name}`:r.name);await this.cache.putListing(e,a)}async refreshBodies(e){for(let t of e.changed)try{await this.readFile(t)}catch(n){e.errors.push({path:t,message:n instanceof Error?n.message:String(n)})}}describe(){return{displayName:`${this.parsed.org}/${this.parsed.repo}${this.parsed.path?`/${this.parsed.path}`:``}`,source:this.source,profile:this.profile}}async close(){this.closed||=!0}};function C(e){let t=e.match(/^s3:\/\/([^/]+)(?:\/(.*))?$/);if(!t)throw Error(`invalid S3 source '${e}' — expected s3://bucket[/prefix]`);return{bucket:t[1],prefix:(t[2]??``).replace(/^\/+/,``).replace(/\/+$/,``)}}var w=26214400,T=class{kind=`s3`;source;profile;mountId;parsed;cache;maxBodyBytes;transport;closed=!1;constructor(e){this.source=e.source,this.profile=e.profile,this.mountId=e.mountId??crypto.randomUUID(),this.parsed=C(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??w,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new c(`EBADF`,`mount closed`,e)}toMountRelative(e){return e.replace(/^\/+/,``)}toS3Key(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``);return[this.parsed.prefix,t].filter(e=>e.length>0).join(`/`)}toMountRelativeKey(e){return this.parsed.prefix?e.slice(this.parsed.prefix.length+1):e}async readFile(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n&&!this.cache.isStale(n.cachedAt))return n.body;let r={};n&&(r[`if-none-match`]=n.etag);let i=await this.transport({method:`GET`,bucket:this.parsed.bucket,key:this.toS3Key(t),headers:r});if(i.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(i.status===404)throw await this.cache.invalidateBody(t),new c(`ENOENT`,`no such file`,e);if(i.status===401||i.status===403)throw new c(`EACCES`,`s3 access denied`,e);if(i.status>=400)throw new c(`EIO`,`s3 readFile failed: ${i.status}`,e);let a=i.headers.get(`content-length`),o=a?Number(a):void 0;if(o!==void 0&&o>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes (${o} > ${this.maxBodyBytes})`,e);let s=new Uint8Array(await i.arrayBuffer());if(s.byteLength>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);let l=i.headers.get(`etag`)??``;return await this.cache.putBody(t,s,l),s}async writeFile(e,t){this.assertOpen(e);let n=this.toMountRelative(e);if(t.byteLength>this.maxBodyBytes)throw new c(`EFBIG`,`body exceeds maxBodyBytes`,e);let r=await this.cache.getBody(n),i={"content-type":`application/octet-stream`,"content-length":String(t.byteLength)};r?i[`if-match`]=r.etag:i[`if-none-match`]=`*`;let a=()=>this.transport({method:`PUT`,bucket:this.parsed.bucket,key:this.toS3Key(n),headers:i,body:t}),o,s=1;try{o=await a()}catch{s=2,o=await a()}if(o.status===412){if(s===2){let r=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(n)});if(r.status>=400)throw new c(`EIO`,`s3 reconcile HEAD failed: ${r.status}`,e);let i=r.headers.get(`etag`)??``;await this.cache.putBody(n,t,i);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a);return}await this.cache.invalidateBody(n);try{await this.readFile(e)}catch{}throw new c(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(o.status===401||o.status===403)throw new c(`EACCES`,`s3 write denied`,e);if(o.status>=400)throw new c(`EIO`,`s3 writeFile failed: ${o.status}`,e);let l=o.headers.get(`etag`)??``;await this.cache.putBody(n,t,l);let u=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(u)}async listObjectsV2(){let e=[],t;do{let n={"list-type":`2`};this.parsed.prefix&&(n.prefix=`${this.parsed.prefix}/`),t&&(n[`continuation-token`]=t);let r=await this.transport({method:`GET`,bucket:this.parsed.bucket,key:``,query:n});if(r.status>=400)throw new c(`EIO`,`s3 list failed: ${r.status}`,`/`);let i=await r.text(),a=this.parseListingXml(i);e.push(...a.contents),t=a.nextContinuationToken}while(t);return e}parseListingXml(e){let t=[];for(let n of e.matchAll(/<Contents>([\s\S]*?)<\/Contents>/g)){let e=n[1],r=e.match(/<Key>([^<]+)<\/Key>/)?.[1]??``,i=e.match(/<ETag>([^<]+)<\/ETag>/)?.[1]??``,a=e.match(/<Size>([^<]+)<\/Size>/)?.[1]??`0`,o=e.match(/<LastModified>([^<]+)<\/LastModified>/)?.[1]??``;t.push({key:r,etag:i,size:Number(a),lastModified:o?Date.parse(o):0})}return{contents:t,nextContinuationToken:e.match(/<IsTruncated>([^<]+)<\/IsTruncated>/)?.[1]===`true`?e.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/)?.[1]:void 0}}async readDir(e){this.assertOpen(e);let t=this.toMountRelative(e).replace(/\/+$/,``),n=await this.cache.getListing(t);if(n&&!this.cache.isStale(n.cachedAt))return n.entries;let r=await this.listObjectsV2(),i=this.groupByDir(r);for(let[e,t]of i)await this.cache.putListing(e,t);return i.get(t)??[]}groupByDir(e){let t=new Map,n=e=>(t.has(e)||t.set(e,[]),t.get(e));n(``);for(let t of e){let e=this.toMountRelativeKey(t.key).split(`/`),r=e.pop();n(e.join(`/`)).push({name:r,kind:`file`,size:t.size,etag:t.etag,lastModified:t.lastModified});let i=``;for(let t of e){let e=i;i=i?`${i}/${t}`:t;let r=n(e);r.find(e=>e.name===t&&e.kind===`directory`)||r.push({name:t,kind:`directory`}),n(i)}}return t}async stat(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n)return{kind:`file`,size:n.body.byteLength,mtime:n.cachedAt,etag:n.etag};let r=t.split(`/`),i=r.pop()??``,a=r.join(`/`),o=await this.cache.getListing(a);if(o&&!this.cache.isStale(o.cachedAt)){let t=o.entries.find(e=>e.name===i);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??o.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??o.cachedAt};if(!t)throw new c(`ENOENT`,`no such file or directory`,e)}let s=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(t)});if(s.status===200){let e=Number(s.headers.get(`content-length`)??`0`),t=s.headers.get(`etag`)??``,n=s.headers.get(`last-modified`);return{kind:`file`,size:e,mtime:n?Date.parse(n):0,etag:t}}if(s.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new c(`ENOENT`,`no such file or directory`,e)}throw new c(`EIO`,`s3 stat failed: ${s.status}`,e)}async refresh(e){this.assertOpen(`/`);let t=await this.listObjectsV2(),n=new Set(t.map(e=>this.toMountRelativeKey(e.key))),r=new Map(t.map(e=>[this.toMountRelativeKey(e.key),e.etag])),i={added:[],removed:[],changed:[],unchanged:0,errors:[]};for(let e of n){let t=await this.cache.getBody(e),n=r.get(e);t?t.etag===n?i.unchanged++:(await this.cache.invalidateBody(e),i.changed.push(e)):i.added.push(e)}let a=this.groupByDir(t);for(let[e,t]of a)await this.cache.putListing(e,t);if(e?.bodies)for(let e of i.changed)try{await this.readFile(e)}catch(t){i.errors.push({path:e,message:t instanceof Error?t.message:String(t)})}return i}async mkdir(e){}async remove(e,t){this.assertOpen(e);let n=this.toMountRelative(e);if(t?.recursive)throw new c(`EINVAL`,`recursive remove not yet supported on S3`,e);let r=await this.transport({method:`DELETE`,bucket:this.parsed.bucket,key:this.toS3Key(n)});if(r.status===404)throw new c(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new c(`EACCES`,`s3 delete denied`,e);if(r.status>=400)throw new c(`EIO`,`s3 delete failed: ${r.status}`,e);await this.cache.invalidateBody(n);let i=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(i)}describe(){return{displayName:this.parsed.prefix?`${this.parsed.bucket}/${this.parsed.prefix}`:this.parsed.bucket,source:this.source,profile:this.profile}}async close(){this.closed||=!0}},E=class extends Error{constructor(e){super(e),this.name=`ProfileNotConfiguredError`}};async function D(){let{getAccounts:t}=await e(async()=>{let{getAccounts:e}=await import(`./account-store-CYDvIaVu.js`).then(e=>e.r);return{getAccounts:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])),n=t().find(e=>e.providerId===`adobe`);if(!n?.accessToken)throw new E(`No Adobe IMS account found. Log in via Settings → Providers → Adobe first.`);return{identity:`adobe-ims`,getBearerToken:async()=>n.accessToken}}var O=`slicc-mount-cache`,k=`listings`,A=`bodies`,j=class{mountId;ttlMs;dbName;dbPromise=null;constructor(e){this.mountId=e.mountId,this.ttlMs=e.ttlMs,this.dbName=e.dbName??O}isStale(e,t){return Date.now()-e>=(t??this.ttlMs)}async openDb(){return this.dbPromise||=new Promise((e,t)=>{let n=indexedDB.open(this.dbName,1);n.onupgradeneeded=()=>{let e=n.result;e.objectStoreNames.contains(k)||e.createObjectStore(k),e.objectStoreNames.contains(A)||e.createObjectStore(A)},n.onsuccess=()=>{let t=n.result;t.onversionchange=()=>{t.close(),this.dbPromise=null},t.onclose=()=>{this.dbPromise=null},e(t)},n.onerror=()=>t(n.error)}),this.dbPromise}key(e){return`${this.mountId}::${e}`}async getListing(e){let t=await this.openDb();return new Promise((n,r)=>{let i=t.transaction(k,`readonly`).objectStore(k).get(this.key(e));i.onsuccess=()=>n(i.result??null),i.onerror=()=>r(i.error)})}async putListing(e,t){let n=await this.openDb();return new Promise((r,i)=>{let a=n.transaction(k,`readwrite`),o={entries:t,cachedAt:Date.now()};a.objectStore(k).put(o,this.key(e)),a.oncomplete=()=>r(),a.onerror=()=>i(a.error)})}async invalidateListing(e){let t=await this.openDb();return new Promise((n,r)=>{let i=t.transaction(k,`readwrite`);i.objectStore(k).delete(this.key(e)),i.oncomplete=()=>n(),i.onerror=()=>r(i.error)})}async getBody(e){let t=await this.openDb();return new Promise((n,r)=>{let i=t.transaction(A,`readonly`).objectStore(A).get(this.key(e));i.onsuccess=()=>n(i.result??null),i.onerror=()=>r(i.error)})}async putBody(e,t,n){let r=await this.openDb(),i={body:t,etag:n,size:t.byteLength,cachedAt:Date.now()};try{await this.txPut(r,A,this.key(e),i)}catch(t){if(t instanceof DOMException&&t.name===`QuotaExceededError`){await this.evictLru(.25);try{await this.txPut(r,A,this.key(e),i)}catch{}return}throw t}}async invalidateBody(e){let t=await this.openDb();return new Promise((n,r)=>{let i=t.transaction(A,`readwrite`);i.objectStore(A).delete(this.key(e)),i.oncomplete=()=>n(),i.onerror=()=>r(i.error)})}async clearMount(){let e=await this.openDb(),t=`${this.mountId}::`,n=n=>new Promise((r,i)=>{let a=e.transaction(n,`readwrite`),o=a.objectStore(n),s=o.getAllKeys();s.onsuccess=()=>{for(let e of s.result)typeof e==`string`&&e.startsWith(t)&&o.delete(e)},a.oncomplete=()=>r(),a.onerror=()=>i(a.error)});await Promise.all([n(k),n(A)])}txPut(e,t,n,r){return new Promise((i,a)=>{let o=e.transaction(t,`readwrite`);o.objectStore(t).put(r,n),o.oncomplete=()=>i(),o.onerror=()=>a(o.error)})}async evictLru(e){let t=await this.openDb(),n=`${this.mountId}::`,r=await new Promise((e,r)=>{let i=t.transaction(A,`readonly`).objectStore(A),a=[],o=i.openCursor();o.onsuccess=()=>{let t=o.result;if(!t){e(a);return}if(typeof t.key==`string`&&t.key.startsWith(n)){let e=t.value;a.push({key:t.key,cachedAt:e.cachedAt})}t.continue()},o.onerror=()=>r(o.error)});r.sort((e,t)=>e.cachedAt-t.cachedAt);let i=Math.max(1,Math.ceil(r.length*e)),a=r.slice(0,i);await new Promise((e,n)=>{let r=t.transaction(A,`readwrite`),i=r.objectStore(A);for(let{key:e}of a)i.delete(e);r.oncomplete=()=>e(),r.onerror=()=>n(r.error)})}},M=r,N=n,P=new Set([`invalid_profile`,`invalid_request`,`profile_not_configured`,`fetch_failed`,`internal`]),F=new Set([101,103,204,205,304]);function I(e){if(!e.ok)throw e.errorCode===`profile_not_configured`||e.errorCode===`invalid_profile`?new c(`EACCES`,e.error):e.errorCode===`invalid_request`?new c(`EINVAL`,e.error):e.errorCode===`fetch_failed`||e.errorCode===`internal`||P.has(String(e.errorCode))?new c(`EIO`,e.error):new c(`EINVAL`,`mount transport returned unrecognized errorCode '${e.errorCode}': ${e.error}`);let t;try{t=M(e.bodyBase64)}catch(e){throw new c(`EIO`,`mount transport: response body decode failed: ${e instanceof Error?e.message:String(e)}`)}let n=F.has(e.status)?null:t;return new Response(n,{status:e.status,headers:new Headers(e.headers)})}async function L(e,t){let n;try{n=await fetch(a(e),{method:`POST`,headers:s({"content-type":`application/json`}),body:JSON.stringify(t)})}catch(e){throw new c(`EIO`,`mount transport failed: ${e instanceof Error?e.message:String(e)} (SLICC backend at localhost may not be running)`)}try{return await n.json()}catch(e){throw new c(`EIO`,`mount transport: response is not a JSON envelope (status ${n.status}): ${e instanceof Error?e.message:String(e)}`)}}async function R(e,t){try{return await chrome.runtime.sendMessage({type:e,envelope:t})}catch(e){throw new c(`EIO`,`mount transport failed: ${e instanceof Error?e.message:String(e)} (extension service worker not responding)`)}}async function z(e,t,n){return i()?R(e,n):o()?l(e,n):L(t,n)}function B(e){return async t=>I(await z(`mount.s3-sign-and-forward`,`/api/s3-sign-and-forward`,{profile:e,method:t.method,bucket:t.bucket,key:t.key,query:t.query,headers:t.headers,bodyBase64:t.body?N(t.body):void 0}))}function V(e){let t=e?.getImsToken??(async()=>(await D()).getBearerToken());return async e=>{let n;try{n=await t()}catch(e){throw new c(`EACCES`,`DA mount: ${e instanceof Error?e.message:String(e)}`)}return I(await z(`mount.da-sign-and-forward`,`/api/da-sign-and-forward`,{imsToken:n,method:e.method,path:e.path,origin:e.origin,query:e.query,headers:e.headers,bodyBase64:e.body?N(e.body):void 0}))}}export{_ as AemMountBackend,S as DaMountBackend,j as RemoteMountCache,T as S3MountBackend,V as makeSignedFetchDa,B as makeSignedFetchS3};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,o as n}from"./proxied-fetch-Co-pb0x0.js";import"./src-CcFD5QfS.js";import{t as r}from"./runtime-env-DadgceZk.js";import{i,n as a,t as o}from"./api-endpoint-C00IT5T9.js";import{t as s}from"./mime-types-D7IV6i7k.js";import"./runtime-env-Dtj99aNH.js";import{t as c}from"./port-bridge-client-Bz2N1tvn.js";import"./backend-local-B6kc_FvN.js";import{t as l}from"./types-idfTVsM8.js";import{t as u}from"./remote-cache-JAv9sQH_.js";const d=`https://api.aem.live`;function f(e){let t=e.match(/^aem:\/\/([^/]+)\/([^/]+)(?:\/(.*))?$/);if(!t)throw Error(`invalid AEM source '${e}' — expected aem://org/site[/path]`);return{org:t[1],site:t[2],path:(t[3]??``).replace(/^\/+/,``).replace(/\/+$/,``)}}function p(e){if(!e)return``;let t=Date.parse(e);return Number.isNaN(t)?``:String(t)}function m(e){let t=Date.parse(e??``);return Number.isNaN(t)?0:t}function h(e){return e.map(e=>e[`content-type`]===`application/folder`||e.name.endsWith(`/`)?{name:e.name.replace(/\/+$/,``),kind:`directory`}:{name:e.name,kind:`file`,size:e.size,etag:p(e[`last-modified`]),lastModified:m(e[`last-modified`])})}var g=class{kind=`aem`;source;profile;mountId;parsed;cache;maxBodyBytes;transport;closed=!1;constructor(e){this.source=e.source,this.profile=e.profile,this.mountId=e.mountId??crypto.randomUUID(),this.parsed=f(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??5242880,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new l(`EBADF`,`mount closed`,e)}toMountRelative(e){return e.replace(/^\/+/,``)}toSourcePath(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``),n=[this.parsed.path,t].filter(e=>e.length>0).join(`/`),r=`/${this.parsed.org}/sites/${this.parsed.site}/source`;return n?`${r}/${n}`:r}toListPath(e){return`${this.toSourcePath(e)}/`}request(e,t,n){return this.transport({method:e,path:t,origin:d,headers:n?.headers,body:n?.body})}async readFile(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n&&!this.cache.isStale(n.cachedAt))return n.body;let r=await this.request(`GET`,this.toSourcePath(t));if(r.status===404)throw await this.cache.invalidateBody(t),new l(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new l(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new l(`EIO`,`aem readFile failed: ${r.status}`,e);let i=new Uint8Array(await r.arrayBuffer());if(i.byteLength>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);return await this.cache.putBody(t,i,p(r.headers.get(`last-modified`))),i}async assertUnchanged(e,t,n){if(!n)return;let r=await this.request(`HEAD`,this.toSourcePath(t));if(r.status===404)return;if(r.status>=400)throw new l(`EIO`,`aem precondition HEAD failed: ${r.status}`,e);let i=p(r.headers.get(`last-modified`));if(i&&i!==n)throw await this.cache.invalidateBody(t),new l(`EBUSY`,`remote modified since last read — re-read and retry`,e)}async writeFile(e,t){if(this.assertOpen(e),t.byteLength>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);let n=this.toMountRelative(e),r=await this.cache.getBody(n);await this.assertUnchanged(e,n,r?.etag??``);let i=await this.request(`PUT`,this.toSourcePath(n),{body:t});if(i.status===401||i.status===403)throw new l(`EACCES`,`aem write denied`,e);if(i.status>=400)throw new l(`EIO`,`aem writeFile failed: ${i.status}`,e);await this.cache.invalidateBody(n);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a)}async readDir(e){this.assertOpen(e);let t=this.toMountRelative(e).replace(/\/+$/,``),n=await this.cache.getListing(t);if(n&&!this.cache.isStale(n.cachedAt))return n.entries;let r=await this.request(`GET`,this.toListPath(t));if(r.status===404)throw new l(`ENOENT`,`no such directory`,e);if(r.status===401||r.status===403)throw new l(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new l(`EIO`,`aem list failed: ${r.status}`,e);let i=h(await r.json());return await this.cache.putListing(t,i),i}async stat(e){this.assertOpen(e);let t=this.toMountRelative(e);if(t===``)return{kind:`directory`,size:0,mtime:0};let n=await this.cache.getBody(t);if(n)return{kind:`file`,size:n.size,mtime:n.cachedAt,etag:n.etag};let r=t.split(`/`),i=r.pop()??``,a=r.join(`/`),o=await this.cache.getListing(a),s=(o&&!this.cache.isStale(o.cachedAt)?o.entries:await this.readDirQuietly(a))?.find(e=>e.name===i);if(!s)throw new l(`ENOENT`,`no such file or directory`,e);return s.kind===`directory`?{kind:`directory`,size:0,mtime:s.lastModified??0}:{kind:`file`,size:s.size??0,mtime:s.lastModified??0,etag:s.etag??``}}async readDirQuietly(e){try{return await this.readDir(e)}catch{return null}}async mkdir(e){}async remove(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.request(`DELETE`,this.toSourcePath(t));if(n.status===404)throw new l(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new l(`EACCES`,`aem delete denied`,e);if(n.status>=400)throw new l(`EIO`,`aem delete failed: ${n.status}`,e);await this.cache.invalidateBody(t);let r=t.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(r)}async refresh(e){this.assertOpen(`/`);let t={added:[],removed:[],changed:[],unchanged:0,errors:[]},n=[``];for(;n.length>0;){let e=n.pop();try{await this.refreshDir(e,t,n)}catch(n){t.errors.push({path:e,message:n instanceof Error?n.message:String(n)})}}return e?.bodies&&await this.refreshBodies(t),t}async classifyFile(e,t,n){let r=await this.cache.getBody(e);r?t&&r.etag!==t?(await this.cache.invalidateBody(e),n.changed.push(e)):n.unchanged++:n.added.push(e)}async refreshDir(e,t,n){let r=await this.request(`GET`,this.toListPath(e));if(r.status===404){await this.cache.putListing(e,[]);return}if(r.status>=400){t.errors.push({path:e,message:`list failed: ${r.status}`});return}let i=h(await r.json());for(let r of i){let i=e?`${e}/${r.name}`:r.name;r.kind===`directory`?n.push(i):await this.classifyFile(i,r.etag??``,t)}await this.cache.putListing(e,i)}async refreshBodies(e){for(let t of e.changed)try{await this.readFile(t)}catch(n){e.errors.push({path:t,message:n instanceof Error?n.message:String(n)})}}describe(){return{displayName:`${this.parsed.org}/${this.parsed.site}${this.parsed.path?`/${this.parsed.path}`:``}`,source:this.source,profile:this.profile}}async close(){this.closed||=!0}};function _(e,t,n){let r=`----DaMount${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`,i=new TextEncoder,a=i.encode(`--${r}\r\nContent-Disposition: form-data; name="data"; filename="${e}"\r\nContent-Type: ${t}\r\n\r\n`),o=i.encode(`\r\n--${r}--\r\n`),s=new Uint8Array(a.byteLength+n.byteLength+o.byteLength);return s.set(a,0),s.set(n,a.byteLength),s.set(o,a.byteLength+n.byteLength),{contentType:`multipart/form-data; boundary=${r}`,body:s}}function v(e){return e.split(`/`).pop()||`data`}function y(e){let t=e.match(/^da:\/\/([^/]+)\/([^/]+)(?:\/(.*))?$/);if(!t)throw Error(`invalid DA source '${e}' — expected da://org/repo[/path]`);return{org:t[1],repo:t[2],path:(t[3]??``).replace(/^\/+/,``).replace(/\/+$/,``)}}var b=class{kind=`da`;source;profile;mountId;parsed;cache;maxBodyBytes;transport;closed=!1;constructor(e){this.source=e.source,this.profile=e.profile,this.mountId=e.mountId??crypto.randomUUID(),this.parsed=y(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??5242880,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new l(`EBADF`,`mount closed`,e)}toMountRelative(e){return e.replace(/^\/+/,``)}toSourcePath(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``),n=[this.parsed.path,t].filter(e=>e.length>0).join(`/`);return`/source/${this.parsed.org}/${this.parsed.repo}${n?`/${n}`:``}`}toListPath(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``),n=[this.parsed.path,t].filter(e=>e.length>0).join(`/`);return`/list/${this.parsed.org}/${this.parsed.repo}${n?`/${n}`:``}`}async readFile(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n&&!this.cache.isStale(n.cachedAt))return n.body;let r={};n&&(r[`if-none-match`]=n.etag);let i=await this.transport({method:`GET`,path:this.toSourcePath(t),headers:r});if(i.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(i.status===404)throw await this.cache.invalidateBody(t),new l(`ENOENT`,`no such file`,e);if(i.status===401||i.status===403)throw new l(`EACCES`,`da access denied`,e);if(i.status>=400)throw new l(`EIO`,`da readFile failed: ${i.status}`,e);let a=i.headers.get(`content-length`),o=a?Number(a):void 0;if(o!==void 0&&o>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);let s=new Uint8Array(await i.arrayBuffer());if(s.byteLength>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);let c=i.headers.get(`etag`)??``,u=c.startsWith(`W/`)?c.slice(2):c;return await this.cache.putBody(t,s,u),s}async writeFile(e,t){if(this.assertOpen(e),t.byteLength>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);let n=this.toMountRelative(e),r=await this.cache.getBody(n),i=_(v(e),s(e),t),a={"content-type":i.contentType,"content-length":String(i.body.byteLength)};r?.etag?a[`if-match`]=r.etag.startsWith(`W/`)?r.etag.slice(2):r.etag:r||(a[`if-none-match`]=`*`);let o=()=>this.transport({method:`POST`,path:this.toSourcePath(n),headers:a,body:i.body}),c,u=1;try{c=await o()}catch{u=2,c=await o()}if(c.status===412){if(u===2){let r=await this.transport({method:`HEAD`,path:this.toSourcePath(n)});if(r.status>=400)throw new l(`EIO`,`da reconcile HEAD failed: ${r.status}`,e);let i=r.headers.get(`etag`)??``;await this.cache.putBody(n,t,i);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a);return}await this.cache.invalidateBody(n);try{await this.readFile(e)}catch{}throw new l(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(c.status===401||c.status===403)throw new l(`EACCES`,`da write denied`,e);if(c.status>=400)throw new l(`EIO`,`da writeFile failed: ${c.status}`,e);let d=c.headers.get(`etag`)??``;await this.cache.putBody(n,t,d);let f=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(f)}async readDir(e){this.assertOpen(e);let t=this.toMountRelative(e).replace(/\/+$/,``),n=await this.cache.getListing(t);if(n&&!this.cache.isStale(n.cachedAt))return n.entries;let r=await this.transport({method:`GET`,path:this.toListPath(t)});if(r.status===404)throw new l(`ENOENT`,`no such directory`,e);if(r.status>=400)throw new l(`EIO`,`da list failed: ${r.status}`,e);let i=(await r.json()).map(e=>e.ext?{name:`${e.name}.${e.ext}`,kind:`file`,etag:e.etag,lastModified:e.lastModified}:{name:e.name,kind:`directory`,lastModified:e.lastModified});return await this.cache.putListing(t,i),i}async stat(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n)return{kind:`file`,size:n.size,mtime:n.cachedAt,etag:n.etag};let r=t.split(`/`),i=r.pop()??``,a=r.join(`/`),o=await this.cache.getListing(a);if(o&&!this.cache.isStale(o.cachedAt)){let t=o.entries.find(e=>e.name===i);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??o.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??o.cachedAt};if(!t)throw new l(`ENOENT`,`no such file or directory`,e)}let s=await this.transport({method:`HEAD`,path:this.toSourcePath(t)});if(s.status===200){let e=Number(s.headers.get(`content-length`)??`0`),t=s.headers.get(`etag`)??``,n=s.headers.get(`last-modified`),r=n?Date.parse(n):0;if(o){let n=o.entries.map(n=>n.name===i&&n.kind===`file`?{...n,size:e,etag:t,lastModified:r}:n);await this.cache.putListing(a,n)}return{kind:`file`,size:e,mtime:r,etag:t}}if(s.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new l(`ENOENT`,`no such file or directory`,e)}throw new l(`EIO`,`da stat failed: ${s.status}`,e)}async mkdir(e){}async remove(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.transport({method:`DELETE`,path:this.toSourcePath(t)});if(n.status===404)throw new l(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new l(`EACCES`,`da delete denied`,e);if(n.status>=400)throw new l(`EIO`,`da delete failed: ${n.status}`,e);await this.cache.invalidateBody(t);let r=t.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(r)}async refresh(e){this.assertOpen(`/`);let t={added:[],removed:[],changed:[],unchanged:0,errors:[]},n=[``];for(;n.length>0;){let e=n.pop();try{await this.refreshDir(e,t,n)}catch(n){t.errors.push({path:e,message:n instanceof Error?n.message:String(n)})}}return e?.bodies&&await this.refreshBodies(t),t}async classifyFile(e,t,n){let r=await this.cache.getBody(e);r?t&&r.etag!==t?(await this.cache.invalidateBody(e),n.changed.push(e)):n.unchanged++:n.added.push(e)}async refreshDir(e,t,n){let r=await this.transport({method:`GET`,path:this.toListPath(e)});if(r.status>=400){t.errors.push({path:e,message:`list failed: ${r.status}`});return}let i=await r.json(),a=[];for(let r of i)if(r.ext){let n=e?`${e}/${r.name}.${r.ext}`:`${r.name}.${r.ext}`;a.push({name:`${r.name}.${r.ext}`,kind:`file`,etag:r.etag,lastModified:r.lastModified}),await this.classifyFile(n,r.etag,t)}else a.push({name:r.name,kind:`directory`}),n.push(e?`${e}/${r.name}`:r.name);await this.cache.putListing(e,a)}async refreshBodies(e){for(let t of e.changed)try{await this.readFile(t)}catch(n){e.errors.push({path:t,message:n instanceof Error?n.message:String(n)})}}describe(){return{displayName:`${this.parsed.org}/${this.parsed.repo}${this.parsed.path?`/${this.parsed.path}`:``}`,source:this.source,profile:this.profile}}async close(){this.closed||=!0}};function x(e){let t=e.match(/^s3:\/\/([^/]+)(?:\/(.*))?$/);if(!t)throw Error(`invalid S3 source '${e}' — expected s3://bucket[/prefix]`);return{bucket:t[1],prefix:(t[2]??``).replace(/^\/+/,``).replace(/\/+$/,``)}}var S=class{kind=`s3`;source;profile;mountId;parsed;cache;maxBodyBytes;transport;closed=!1;constructor(e){this.source=e.source,this.profile=e.profile,this.mountId=e.mountId??crypto.randomUUID(),this.parsed=x(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??26214400,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new l(`EBADF`,`mount closed`,e)}toMountRelative(e){return e.replace(/^\/+/,``)}toS3Key(e){let t=e.replace(/^\/+/,``).replace(/\/+$/,``);return[this.parsed.prefix,t].filter(e=>e.length>0).join(`/`)}toMountRelativeKey(e){return this.parsed.prefix?e.slice(this.parsed.prefix.length+1):e}async readFile(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n&&!this.cache.isStale(n.cachedAt))return n.body;let r={};n&&(r[`if-none-match`]=n.etag);let i=await this.transport({method:`GET`,bucket:this.parsed.bucket,key:this.toS3Key(t),headers:r});if(i.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(i.status===404)throw await this.cache.invalidateBody(t),new l(`ENOENT`,`no such file`,e);if(i.status===401||i.status===403)throw new l(`EACCES`,`s3 access denied`,e);if(i.status>=400)throw new l(`EIO`,`s3 readFile failed: ${i.status}`,e);let a=i.headers.get(`content-length`),o=a?Number(a):void 0;if(o!==void 0&&o>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes (${o} > ${this.maxBodyBytes})`,e);let s=new Uint8Array(await i.arrayBuffer());if(s.byteLength>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);let c=i.headers.get(`etag`)??``;return await this.cache.putBody(t,s,c),s}async writeFile(e,t){this.assertOpen(e);let n=this.toMountRelative(e);if(t.byteLength>this.maxBodyBytes)throw new l(`EFBIG`,`body exceeds maxBodyBytes`,e);let r=await this.cache.getBody(n),i={"content-type":`application/octet-stream`,"content-length":String(t.byteLength)};r?i[`if-match`]=r.etag:i[`if-none-match`]=`*`;let a=()=>this.transport({method:`PUT`,bucket:this.parsed.bucket,key:this.toS3Key(n),headers:i,body:t}),o,s=1;try{o=await a()}catch{s=2,o=await a()}if(o.status===412){if(s===2){let r=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(n)});if(r.status>=400)throw new l(`EIO`,`s3 reconcile HEAD failed: ${r.status}`,e);let i=r.headers.get(`etag`)??``;await this.cache.putBody(n,t,i);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a);return}await this.cache.invalidateBody(n);try{await this.readFile(e)}catch{}throw new l(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(o.status===401||o.status===403)throw new l(`EACCES`,`s3 write denied`,e);if(o.status>=400)throw new l(`EIO`,`s3 writeFile failed: ${o.status}`,e);let c=o.headers.get(`etag`)??``;await this.cache.putBody(n,t,c);let u=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(u)}async listObjectsV2(){let e=[],t;do{let n={"list-type":`2`};this.parsed.prefix&&(n.prefix=`${this.parsed.prefix}/`),t&&(n[`continuation-token`]=t);let r=await this.transport({method:`GET`,bucket:this.parsed.bucket,key:``,query:n});if(r.status>=400)throw new l(`EIO`,`s3 list failed: ${r.status}`,`/`);let i=await r.text(),a=this.parseListingXml(i);e.push(...a.contents),t=a.nextContinuationToken}while(t);return e}parseListingXml(e){let t=[];for(let n of e.matchAll(/<Contents>([\s\S]*?)<\/Contents>/g)){let e=n[1],r=e.match(/<Key>([^<]+)<\/Key>/)?.[1]??``,i=e.match(/<ETag>([^<]+)<\/ETag>/)?.[1]??``,a=e.match(/<Size>([^<]+)<\/Size>/)?.[1]??`0`,o=e.match(/<LastModified>([^<]+)<\/LastModified>/)?.[1]??``;t.push({key:r,etag:i,size:Number(a),lastModified:o?Date.parse(o):0})}return{contents:t,nextContinuationToken:e.match(/<IsTruncated>([^<]+)<\/IsTruncated>/)?.[1]===`true`?e.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/)?.[1]:void 0}}async readDir(e){this.assertOpen(e);let t=this.toMountRelative(e).replace(/\/+$/,``),n=await this.cache.getListing(t);if(n&&!this.cache.isStale(n.cachedAt))return n.entries;let r=await this.listObjectsV2(),i=this.groupByDir(r);for(let[e,t]of i)await this.cache.putListing(e,t);return i.get(t)??[]}groupByDir(e){let t=new Map,n=e=>(t.has(e)||t.set(e,[]),t.get(e));n(``);for(let t of e){let e=this.toMountRelativeKey(t.key).split(`/`),r=e.pop();n(e.join(`/`)).push({name:r,kind:`file`,size:t.size,etag:t.etag,lastModified:t.lastModified});let i=``;for(let t of e){let e=i;i=i?`${i}/${t}`:t;let r=n(e);r.find(e=>e.name===t&&e.kind===`directory`)||r.push({name:t,kind:`directory`}),n(i)}}return t}async stat(e){this.assertOpen(e);let t=this.toMountRelative(e),n=await this.cache.getBody(t);if(n)return{kind:`file`,size:n.body.byteLength,mtime:n.cachedAt,etag:n.etag};let r=t.split(`/`),i=r.pop()??``,a=r.join(`/`),o=await this.cache.getListing(a);if(o&&!this.cache.isStale(o.cachedAt)){let t=o.entries.find(e=>e.name===i);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??o.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??o.cachedAt};if(!t)throw new l(`ENOENT`,`no such file or directory`,e)}let s=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(t)});if(s.status===200){let e=Number(s.headers.get(`content-length`)??`0`),t=s.headers.get(`etag`)??``,n=s.headers.get(`last-modified`);return{kind:`file`,size:e,mtime:n?Date.parse(n):0,etag:t}}if(s.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new l(`ENOENT`,`no such file or directory`,e)}throw new l(`EIO`,`s3 stat failed: ${s.status}`,e)}async refresh(e){this.assertOpen(`/`);let t=await this.listObjectsV2(),n=new Set(t.map(e=>this.toMountRelativeKey(e.key))),r=new Map(t.map(e=>[this.toMountRelativeKey(e.key),e.etag])),i={added:[],removed:[],changed:[],unchanged:0,errors:[]};for(let e of n){let t=await this.cache.getBody(e),n=r.get(e);t?t.etag===n?i.unchanged++:(await this.cache.invalidateBody(e),i.changed.push(e)):i.added.push(e)}let a=this.groupByDir(t);for(let[e,t]of a)await this.cache.putListing(e,t);if(e?.bodies)for(let e of i.changed)try{await this.readFile(e)}catch(t){i.errors.push({path:e,message:t instanceof Error?t.message:String(t)})}return i}async mkdir(e){}async remove(e,t){this.assertOpen(e);let n=this.toMountRelative(e);if(t?.recursive)throw new l(`EINVAL`,`recursive remove not yet supported on S3`,e);let r=await this.transport({method:`DELETE`,bucket:this.parsed.bucket,key:this.toS3Key(n)});if(r.status===404)throw new l(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new l(`EACCES`,`s3 delete denied`,e);if(r.status>=400)throw new l(`EIO`,`s3 delete failed: ${r.status}`,e);await this.cache.invalidateBody(n);let i=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(i)}describe(){return{displayName:this.parsed.prefix?`${this.parsed.bucket}/${this.parsed.prefix}`:this.parsed.bucket,source:this.source,profile:this.profile}}async close(){this.closed||=!0}},C=class extends Error{constructor(e){super(e),this.name=`ProfileNotConfiguredError`}};async function w(){let{getAccounts:e}=await import(`./account-store-2HXGXOYw.js`).then(e=>e.r),t=e().find(e=>e.providerId===`adobe`);if(!t?.accessToken)throw new C(`No Adobe IMS account found. Log in via Settings → Providers → Adobe first.`);return{identity:`adobe-ims`,getBearerToken:async()=>t.accessToken}}const T=c({portName:`mount.sign-and-forward`,panelRpcOp:`mount-sign-and-forward`,timeoutMs:12e4,onUnavailable:`reject`,makeError:e=>new l(`EIO`,`mount transport failed: ${e}`),logNamespace:`mount-bridge`,toPortMessage:({type:e,envelope:t})=>({type:e,envelope:t}),toPanelRpcPayload:({type:e,envelope:t})=>({type:e,envelope:t})});function E(e,t){return T({type:e,envelope:t})}const D=t,O=n,k=new Set([`invalid_profile`,`invalid_request`,`profile_not_configured`,`fetch_failed`,`internal`]),A=new Set([101,103,204,205,304]);function j(e){if(!e.ok)throw e.errorCode===`profile_not_configured`||e.errorCode===`invalid_profile`?new l(`EACCES`,e.error):e.errorCode===`invalid_request`?new l(`EINVAL`,e.error):e.errorCode===`fetch_failed`||e.errorCode===`internal`||k.has(String(e.errorCode))?new l(`EIO`,e.error):new l(`EINVAL`,`mount transport returned unrecognized errorCode '${e.errorCode}': ${e.error}`);let t;try{t=D(e.bodyBase64)}catch(e){throw new l(`EIO`,`mount transport: response body decode failed: ${e instanceof Error?e.message:String(e)}`)}let n=A.has(e.status)?null:t;return new Response(n,{status:e.status,headers:new Headers(e.headers)})}async function M(e,t){let n;try{n=await fetch(i(e),{method:`POST`,headers:o({"content-type":`application/json`}),body:JSON.stringify(t)})}catch(e){throw new l(`EIO`,`mount transport failed: ${e instanceof Error?e.message:String(e)} (SLICC backend at localhost may not be running)`)}try{return await n.json()}catch(e){throw new l(`EIO`,`mount transport: response is not a JSON envelope (status ${n.status}): ${e instanceof Error?e.message:String(e)}`)}}async function N(e,t){try{return await chrome.runtime.sendMessage({type:e,envelope:t})}catch(e){throw new l(`EIO`,`mount transport failed: ${e instanceof Error?e.message:String(e)} (extension service worker not responding)`)}}async function P(e,t,n){return r()?N(e,n):a()?E(e,n):M(t,n)}function F(e){return async t=>j(await P(`mount.s3-sign-and-forward`,`/api/s3-sign-and-forward`,{profile:e,method:t.method,bucket:t.bucket,key:t.key,query:t.query,headers:t.headers,bodyBase64:t.body?O(t.body):void 0}))}function I(e){let t=e?.getImsToken??(async()=>(await w()).getBearerToken());return async e=>{let n;try{n=await t()}catch(e){throw new l(`EACCES`,`DA mount: ${e instanceof Error?e.message:String(e)}`)}return j(await P(`mount.da-sign-and-forward`,`/api/da-sign-and-forward`,{imsToken:n,method:e.method,path:e.path,origin:e.origin,query:e.query,headers:e.headers,bodyBase64:e.body?O(e.body):void 0}))}}var L=e({AEM_SOURCE_BUS_ORIGIN:()=>d,AemMountBackend:()=>g,DaMountBackend:()=>b,RemoteMountCache:()=>u,S3MountBackend:()=>S,makeSignedFetchDa:()=>I,makeSignedFetchS3:()=>F});export{b as a,S as i,I as n,d as o,F as r,g as s,L as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./provider-B6wQUVzw.js";export{e as readMcpAuthEntries};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./store-Bk60qy3q.js";export{e as readMcpAuthEntries};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/panel-rpc-B3MSVImO.js","assets/rolldown-runtime-Dd_uD5pT.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./preload-helper-Czpn1I53.js";import{n,t as r}from"./base64-DpPqYZJF.js";import"./src-CAWTvdAa.js";import{n as i}from"./runtime-env-Dlaokqg1.js";import{t as a}from"./fetch-body-D2PwksUW.js";import{i as o,n as s,r as c,t as l}from"./api-endpoint-GRCyib6X.js";function u(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`text/`)||t.includes(`json`)||t.includes(`xml`)||t.includes(`javascript`)||t.includes(`ecmascript`)||t.includes(`html`)||t.includes(`css`)||t.includes(`svg`)}var d=new Map,f=new Map;function p(e,t){d.set(e,t),setTimeout(()=>d.delete(e),1e4)}function m(e,t){f.set(e,t),setTimeout(()=>f.delete(e),1e4)}function h(e){return e.headers.get(`x-proxy-error`)===`1`}async function g(e){let t=`Proxy error ${e.status}`,n;try{n=await e.text()}catch{return t}return _(n,t)}function _(e,t){let n;try{n=JSON.parse(e)}catch{return t}if(!n||typeof n!=`object`)return t;let r=n.error;if(typeof r==`string`&&r.length>0)return r;if(r&&typeof r==`object`){let e=r.message;if(typeof e==`string`&&e.length>0)return e;try{return JSON.stringify(r)}catch{return t}}return t}function v(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e===`cookie`?t[`X-Proxy-Cookie`]=r:e===`origin`?t[`X-Proxy-Origin`]=r:e===`referer`?t[`X-Proxy-Referer`]=r:e.startsWith(`proxy-`)?t[`X-Proxy-${n}`]=r:t[n]=r}return t}function y(e){let t={};for(let[n,r]of Object.entries(e))n.toLowerCase()===`x-proxy-set-cookie`?t[`set-cookie`]=r:t[n]=r;return t}function b(e){if(e){if(e instanceof Headers){let t={};return e.forEach((e,n)=>{t[n]=e}),t}return e}}var x=e({BINARY_CACHE_BODY_CAP:()=>w,PROXY_CONTENT_LENGTH_HEADER:()=>M,collectViaExtensionDelegate:()=>W,createProxiedFetch:()=>G,decodeForbiddenResponseHeaders:()=>L,encodeForbiddenRequestHeaders:()=>I,getLocalApiBaseUrl:()=>c,headersToRecord:()=>j,isTextContentType:()=>u,prepareRequestBody:()=>F,readResponseBody:()=>O,responseTooLargeError:()=>T}),S=33554432,C=536870912,w=33554432;function T(e,t){let n=Math.round(C/1048576),r=t===void 0?``:` (${t} bytes)`;return Error(`proxied-fetch: response body for ${e} exceeds the ${n} MiB download limit${r}; download it in ranges (curl -r) or from a native float`)}var E=new Set([101,103,204,205,304]);function D(){return o(`/api/fetch-proxy`)}async function O(e,t,n,r){let i=e.headers.get(`content-type`)??``,a=r??N(e.headers);if(a!==void 0&&a>C)throw await e.body?.cancel().catch(()=>void 0),T(t??e.url,a);let o=await A(e,t??e.url,n,a);return k(o,i,t),o}function k(e,t,n){if(u(t)||e.byteLength>33554432)return;if(n){m(n,e);return}let r=``;for(let t=0;t<e.length;t+=32768)r+=String.fromCharCode(...e.subarray(t,t+32768));p(r,e)}async function A(e,t,n,r){if(!e.body)return new Uint8Array(await e.arrayBuffer());let i=e.body.getReader(),a=r!==void 0&&r>0?new Uint8Array(r):null,o=[],s=0;for(;;){let{done:e,value:r}=await i.read();if(e)break;let c=r;if(a?s+c.byteLength<=a.byteLength?a.set(c,s):(o.push(a.subarray(0,s),c),a=null):o.push(c),s+=c.byteLength,s>C)throw await i.cancel().catch(()=>void 0),T(t,void 0);n?.(s)}return a?s===a.byteLength?a:a.slice(0,s):z(o)}var j=b,M=`x-proxy-content-length`;function N(e){let t=t=>e instanceof Headers?e.get(t):Object.entries(e).find(([e])=>e.toLowerCase()===t)?.[1]??null,n=t(`x-proxy-content-length`)??t(`content-length`);if(n==null||!/^\d+$/.test(n))return;let r=Number(n);return Number.isSafeInteger(r)&&r>=0?r:void 0}async function P(e,t,n){if(!e)return n();try{return await n()}finally{e.end(t)}}function F(e,t){if(!e)return;let n=Object.entries(t??{}).find(([e])=>e.toLowerCase()===`content-type`)?.[1]??``;if(n&&!u(n)){let t=a(e);return new Blob([t])}return e}var I=v,L=y,R=r;function z(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function B(e,t,n){let r=new Headers;for(let[t,n]of Object.entries(e.headers))r.set(t,String(n));let i=E.has(e.status)?new Uint8Array:t;return k(i,r.get(`content-type`)??``,n),{status:e.status,statusText:e.statusText,headers:L(e.headers),body:i,url:n}}async function V(e){let t=j(e?.headers),r=e?.method??`GET`,i=e?.body?F(e.body,t):void 0,a=I(t),o,s=!1;if(i!==void 0){let e=i instanceof Uint8Array?i:new Uint8Array(await new Response(i).arrayBuffer());e.byteLength>S?s=!0:o=n(e)}return{method:r,transportHeaders:a,bodyBase64:o,requestBodyTooLarge:s}}async function H(e,t,n,r){let{method:i,transportHeaders:a,bodyBase64:o,requestBodyTooLarge:s}=await V(n),c=e();return new Promise((e,n)=>{let l=null,u=!1,d=0,f,p=[],m=e=>{u=!0,p.length=0,n(e),c.disconnect()},h=e=>{if(l={status:e.status,statusText:e.statusText,headers:e.headers},f=N(e.headers),f!==void 0&&f>C){m(T(t,f));return}r?.start(t,f)},g=e=>{if(u)return;let n=R(e.dataBase64);if(d+=n.byteLength,d>C){m(T(t,void 0));return}p.push(n),r?.chunk(t,d,f)},_=()=>{if(!u){if(u=!0,!l){n(Error(`fetch-proxy: response-end before response-head`));return}e({head:l,body:z(p).buffer}),c.disconnect()}};c.onMessage.addListener(e=>{let t=e;t.type===`response-head`?h(t):t.type===`response-chunk`?g(t):t.type===`response-end`?_():t.type===`response-error`&&m(Error(t.error))}),c.onDisconnect.addListener(()=>{u||n(Error(l?`fetch-proxy port disconnected mid-stream`:`fetch-proxy port disconnected before response`))}),c.postMessage({type:`request`,url:t,method:i,headers:a,bodyBase64:o,requestBodyTooLarge:s})})}async function U(e,t,n){let{head:r,body:i}=await P(n,e,()=>H(()=>chrome.runtime.connect({name:`fetch-proxy.fetch`}),e,t,n));return B(r,new Uint8Array(i),e)}async function W(e,t,n){let r=s();if(!r)throw Error(`proxied-fetch: no extension delegate id configured`);let i=chrome.runtime.connect;return H(()=>i(r,{name:`fetch-proxy.fetch`}),e,t,n)}function G(e={}){let n=e.progress;return i()?(e,t)=>U(e,t,n):typeof chrome<`u`&&typeof chrome?.runtime?.connect==`function`&&s()?async(e,t)=>{let{head:r,body:i}=await P(n,e,()=>W(e,t,n));return B(r,new Uint8Array(i),e)}:typeof chrome>`u`&&s()?async(e,r)=>{let{getPanelRpcClient:i}=await t(async()=>{let{getPanelRpcClient:e}=await import(`./panel-rpc-B3MSVImO.js`).then(e=>e.i);return{getPanelRpcClient:e}},__vite__mapDeps([0,1])),a=i();if(!a)throw Error(`proxied-fetch: panel-RPC client unavailable in worker realm`);let o=r?.method??`GET`,s=j(r?.headers)??{};n?.start(e,void 0);let{head:c,body:l}=await P(n,e,()=>a.call(`proxied-fetch`,{url:e,method:o,headers:s,body:r?.body},{timeoutMs:12e4}));return B(c,new Uint8Array(l),e)}:async(e,t)=>{let r=t?.method??`GET`,i=I(j(t?.headers)),a=l({...i,"X-Target-URL":e}),o={method:r,headers:a,cache:`no-store`};return t?.body&&![`GET`,`HEAD`].includes(r)&&(o.body=F(t.body,a)),P(n,e,async()=>{let t=await fetch(D(),o);if(h(t))throw Error(await g(t));let r=N(t.headers);n?.start(e,r);let i=await O(t,e,n?t=>n.chunk(e,t,r):void 0,r),a={};t.headers.forEach((e,t)=>{a[t]=e});let s=L(a);return{status:t.status,statusText:t.statusText,headers:s,body:i,url:e}})}}export{g as i,x as n,h as r,G as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import"./src-CcFD5QfS.js";import{t}from"./runtime-env-DadgceZk.js";import{n,t as r}from"./binary-cache-bSOhqXB1.js";import{n as i}from"./fetch-body-DDu_AU5I.js";import{i as a,n as o,r as s,t as c}from"./api-endpoint-C00IT5T9.js";const l=32768;function u(){return globalThis.Buffer}const d=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})?$/;function f(e){let t=u();if(t){if(!d.test(e))throw Error(`Invalid base64 string`);return new Uint8Array(t.from(e,`base64`))}let n=atob(e),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function p(e){let t=u();if(t)return t.from(e).toString(`base64`);let n=``;for(let t=0;t<e.byteLength;t+=l){let r=e.subarray(t,Math.min(t+l,e.byteLength));n+=String.fromCharCode.apply(null,r)}return btoa(n)}function m(e){if(!e)return!1;let t=e.toLowerCase();return t.startsWith(`text/`)||t.includes(`json`)||t.includes(`xml`)||t.includes(`javascript`)||t.includes(`ecmascript`)||t.includes(`html`)||t.includes(`css`)||t.includes(`svg`)}function h(e){return e.headers.get(`x-proxy-error`)===`1`}async function g(e){let t=`Proxy error ${e.status}`,n;try{n=await e.text()}catch{return t}return _(n,t)}function _(e,t){let n;try{n=JSON.parse(e)}catch{return t}if(!n||typeof n!=`object`)return t;let r=n.error;if(typeof r==`string`&&r.length>0)return r;if(r&&typeof r==`object`){let e=r.message;if(typeof e==`string`&&e.length>0)return e;try{return JSON.stringify(r)}catch{return t}}return t}function v(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e===`cookie`?t[`X-Proxy-Cookie`]=r:e===`origin`?t[`X-Proxy-Origin`]=r:e===`referer`?t[`X-Proxy-Referer`]=r:e.startsWith(`proxy-`)?t[`X-Proxy-${n}`]=r:t[n]=r}return t}function y(e){let t={};for(let[n,r]of Object.entries(e))n.toLowerCase()===`x-proxy-set-cookie`?t[`set-cookie`]=r:t[n]=r;return t}function b(e){if(e){if(e instanceof Headers){let t={};return e.forEach((e,n)=>{t[n]=e}),t}return e}}function x(e){if(!e)return;if(e instanceof Headers){let t={};return e.forEach((e,n)=>{t[n]=e}),Object.keys(t).length===0?void 0:t}if(Array.isArray(e)){let t={};for(let[n,r]of e)t[n]=r;return Object.keys(t).length===0?void 0:t}let t={...e};return Object.keys(t).length===0?void 0:t}var S=e({BINARY_CACHE_BODY_CAP:()=>w,PROXY_CONTENT_LENGTH_HEADER:()=>M,collectViaExtensionDelegate:()=>W,createProxiedFetch:()=>G,decodeForbiddenResponseHeaders:()=>L,encodeForbiddenRequestHeaders:()=>I,getLocalApiBaseUrl:()=>s,headersToRecord:()=>j,isTextContentType:()=>m,prepareRequestBody:()=>F,readResponseBody:()=>O,responseTooLargeError:()=>T});let C=536870912;const w=33554432;function T(e,t){let n=t===void 0?``:` (${t} bytes)`;return Error(`proxied-fetch: response body for ${e} exceeds the 512 MiB download limit${n}; download it in ranges (curl -r) or from a native float`)}const E=new Set([101,103,204,205,304]);function D(){return a(`/api/fetch-proxy`)}async function O(e,t,n,r){let i=e.headers.get(`content-type`)??``,a=r??N(e.headers);if(a!==void 0&&a>C)throw await e.body?.cancel().catch(()=>void 0),T(t??e.url,a);let o=await A(e,t??e.url,n,a);return k(o,i,t),o}function k(e,t,i){if(m(t)||e.byteLength>33554432)return;if(i){n(i,e);return}let a=``;for(let t=0;t<e.length;t+=32768)a+=String.fromCharCode(...e.subarray(t,t+32768));r(a,e)}async function A(e,t,n,r){if(!e.body)return new Uint8Array(await e.arrayBuffer());let i=e.body.getReader(),a=r!==void 0&&r>0?new Uint8Array(r):null,o=[],s=0;for(;;){let{done:e,value:r}=await i.read();if(e)break;let c=r;if(a?s+c.byteLength<=a.byteLength?a.set(c,s):(o.push(a.subarray(0,s),c),a=null):o.push(c),s+=c.byteLength,s>C)throw await i.cancel().catch(()=>void 0),T(t,void 0);n?.(s)}return a?s===a.byteLength?a:a.slice(0,s):z(o)}const j=b,M=`x-proxy-content-length`;function N(e){let t=t=>e instanceof Headers?e.get(t):Object.entries(e).find(([e])=>e.toLowerCase()===t)?.[1]??null,n=t(`x-proxy-content-length`)??t(`content-length`);if(n==null||!/^\d+$/.test(n))return;let r=Number(n);return Number.isSafeInteger(r)&&r>=0?r:void 0}async function P(e,t,n){if(!e)return n();try{return await n()}finally{e.end(t)}}function F(e,t){if(!e)return;let n=Object.entries(t??{}).find(([e])=>e.toLowerCase()===`content-type`)?.[1]??``;if(n&&!m(n)){let t=i(e);return new Blob([t])}return e}const I=v,L=y,R=f;function z(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function B(e,t,n){let r=new Headers;for(let[t,n]of Object.entries(e.headers))r.set(t,String(n));let i=E.has(e.status)?new Uint8Array:t;return k(i,r.get(`content-type`)??``,n),{status:e.status,statusText:e.statusText,headers:L(e.headers),body:i,url:n}}async function V(e){let t=j(e?.headers),n=e?.method??`GET`,r=e?.body?F(e.body,t):void 0,i=I(t),a,o=!1;if(r!==void 0){let e=r instanceof Uint8Array?r:new Uint8Array(await new Response(r).arrayBuffer());e.byteLength>33554432?o=!0:a=p(e)}return{method:n,transportHeaders:i,bodyBase64:a,requestBodyTooLarge:o}}async function H(e,t,n,r){let{method:i,transportHeaders:a,bodyBase64:o,requestBodyTooLarge:s}=await V(n),c=e();return new Promise((e,n)=>{let l=null,u=!1,d=0,f,p=[],m=e=>{u=!0,p.length=0,n(e),c.disconnect()},h=e=>{if(l={status:e.status,statusText:e.statusText,headers:e.headers},f=N(e.headers),f!==void 0&&f>C){m(T(t,f));return}r?.start(t,f)},g=e=>{if(u)return;let n=R(e.dataBase64);if(d+=n.byteLength,d>C){m(T(t,void 0));return}p.push(n),r?.chunk(t,d,f)},_=()=>{if(!u){if(u=!0,!l){n(Error(`fetch-proxy: response-end before response-head`));return}e({head:l,body:z(p).buffer}),c.disconnect()}};c.onMessage.addListener(e=>{let t=e;t.type===`response-head`?h(t):t.type===`response-chunk`?g(t):t.type===`response-end`?_():t.type===`response-error`&&m(Error(t.error))}),c.onDisconnect.addListener(()=>{u||n(Error(l?`fetch-proxy port disconnected mid-stream`:`fetch-proxy port disconnected before response`))}),c.postMessage({type:`request`,url:t,method:i,headers:a,bodyBase64:o,requestBodyTooLarge:s})})}async function U(e,t,n){let{head:r,body:i}=await P(n,e,()=>H(()=>chrome.runtime.connect({name:`fetch-proxy.fetch`}),e,t,n));return B(r,new Uint8Array(i),e)}async function W(e,t,n){let r=o();if(!r)throw Error(`proxied-fetch: no extension delegate id configured`);let i=chrome.runtime.connect;return H(()=>i(r,{name:`fetch-proxy.fetch`}),e,t,n)}function G(e={}){let n=e.progress;return t()?(e,t)=>U(e,t,n):typeof chrome<`u`&&typeof chrome?.runtime?.connect==`function`&&o()?async(e,t)=>{let{head:r,body:i}=await P(n,e,()=>W(e,t,n));return B(r,new Uint8Array(i),e)}:typeof chrome>`u`&&o()?async(e,t)=>{let{getPanelRpcClient:r}=await import(`./panel-rpc-BPwAqRch.js`).then(e=>e.i),i=r();if(!i)throw Error(`proxied-fetch: panel-RPC client unavailable in worker realm`);let a=t?.method??`GET`,o=j(t?.headers)??{};n?.start(e,void 0);let{head:s,body:c}=await P(n,e,()=>i.call(`proxied-fetch`,{url:e,method:a,headers:o,body:t?.body},{timeoutMs:12e4}));return B(s,new Uint8Array(c),e)}:async(e,t)=>{let r=t?.method??`GET`,i=j(t?.headers),a=I(i),o=c({...a,"X-Target-URL":e}),s={method:r,headers:o,cache:`no-store`};return t?.body&&![`GET`,`HEAD`].includes(r)&&(s.body=F(t.body,o)),P(n,e,async()=>{let t=await fetch(D(),s);if(h(t))throw Error(await g(t));let r=N(t.headers);n?.start(e,r);let i=await O(t,e,n?t=>n.chunk(e,t,r):void 0,r),a={};t.headers.forEach((e,t)=>{a[t]=e});let o=L(a);return{status:t.status,statusText:t.statusText,headers:o,body:i,url:e}})}}export{f as a,m as i,S as n,p as o,x as r,G as t};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./proxied-fetch-Co-pb0x0.js";import"./src-CcFD5QfS.js";import{p as t,v as n}from"./state-iYgYrNhF.js";const r=new TextEncoder;function i(e){return typeof e==`object`&&!!e&&`exitCode`in e}async function a(e,t){try{return await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,t))}catch{return{message:`curlwright: cannot read ${t}`,exitCode:26}}}function o(e){let t=new Uint8Array(e.length),n=0;for(let r of e)r!==10&&r!==13&&(t[n++]=r);return t.subarray(0,n)}async function s(e,t){let n=t.indexOf(`=`),o=t.indexOf(`@`),s=o!==-1&&(n===-1||o<n),c=s?o:n,l=c===-1?``:t.slice(0,c),u=c===-1?t:t.slice(c+1),d=u;if(s){let t=await a(e,u);if(i(t))return t;d=new TextDecoder().decode(t)}let f=encodeURIComponent(d);return r.encode(l===``?f:`${l}=${f}`)}async function c(e,t){if(t.kind===`urlencode`)return s(e,t.value);if(t.kind===`raw`||!t.value.startsWith(`@`))return r.encode(t.value);let n=await a(e,t.value.slice(1));return i(n)||t.kind===`binary`?n:o(n)}function l(e){let t=Math.max(0,e.length-1),n=e.reduce((e,t)=>e+t.length,0)+t,r=new Uint8Array(n),i=0;return e.forEach((e,t)=>{t>0&&(r[i++]=38),r.set(e,i),i+=e.length}),r}function u(e){let t=e.split(`;`);return{value:t[0],options:t.slice(1)}}function d(e,t){for(let n of e){let e=n.trim();if(e.startsWith(`${t}=`))return e.slice(t.length+1)}return null}function f(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}async function p(e,t,n){let r=n.value.indexOf(`=`);if(r===-1)return{message:`curlwright: -F requires name=content (got "${n.value}")`,exitCode:2};let o=n.value.slice(0,r),s=n.value.slice(r+1);if(n.literal||s[0]!==`@`&&s[0]!==`<`)return t.append(o,s),null;let{value:c,options:l}=u(s.slice(1)),p=await a(e,c);if(i(p))return p;if(s[0]===`<`)return t.append(o,new TextDecoder().decode(p)),null;let m=d(l,`type`)??`application/octet-stream`,h=d(l,`filename`)??f(c);return t.append(o,new Blob([p],{type:m}),h),null}async function m(e,t,n){if(t.length>0&&n.length>0)return{message:`curlwright: -F cannot be combined with -d`,exitCode:2};if(n.length>0){let t=new FormData;for(let r of n){let n=await p(e,t,r);if(n)return n}return{bytes:null,form:t,contentType:null,accept:null}}if(t.length===0)return{bytes:null,form:null,contentType:null,accept:null};let r=[];for(let n of t){let t=await c(e,n);if(i(t))return t;r.push(t)}let a=t.some(e=>e.kind===`json`);return{bytes:l(r),form:null,contentType:a?`application/json`:`application/x-www-form-urlencoded`,accept:a?`application/json`:null}}const h=new Set([`request`,`header`,`data`,`data-raw`,`data-binary`,`data-ascii`,`data-urlencode`,`json`,`form`,`form-string`,`output`,`dump-header`,`write-out`,`max-time`,`user`,`referer`,`range`,`url`,`tab`,`frame`]),g=new Set([`silent`,`show-error`,`include`,`head`,`verbose`,`fail`,`location`,`remote-name`,`get`,`no-credentials`,`help`]),_={X:`request`,H:`header`,d:`data`,F:`form`,o:`output`,D:`dump-header`,w:`write-out`,m:`max-time`,u:`user`,e:`referer`,r:`range`},v={s:`silent`,S:`show-error`,i:`include`,I:`head`,v:`verbose`,f:`fail`,L:`location`,O:`remote-name`,G:`get`,h:`help`},y={cert:`client certificates are the browser profile's to present, not the shell's`,"cert-type":`client certificates are the browser profile's to present, not the shell's`,key:`client certificates are the browser profile's to present, not the shell's`,cacert:`the browser decides which roots to trust`,capath:`the browser decides which roots to trust`,insecure:`the browser enforces TLS verification; a page cannot opt out`,proxy:`proxying is configured on the browser, not per request`,"proxy-user":`proxying is configured on the browser, not per request`,interface:`a page cannot choose an outgoing interface`,"unix-socket":`a page cannot dial a unix socket`,resolve:`a page cannot override DNS resolution`,compressed:`always on — the browser negotiates encoding itself`,cookie:"the tab's own cookies are already sent; set one with `playwright-cli cookie-set`","cookie-jar":"cookies live in the browser profile; read them with `playwright-cli cookies`","limit-rate":`a page cannot throttle a fetch`,"continue-at":"a page fetch cannot resume; use `-H 'Range: bytes=N-'`","connect-timeout":"a page fetch cannot time the connect phase alone; use `--max-time`","http1.1":`the browser negotiates the HTTP version`,http2:`the browser negotiates the HTTP version`,http3:`the browser negotiates the HTTP version`,"no-buffer":`responses are read whole, never streamed to stdout`,"trace-ascii":"no wire trace exists; use `playwright-cli network-requests`",trace:"no wire trace exists; use `playwright-cli network-requests`","user-agent":`User-Agent is a forbidden header name for fetch(); the tab sets it`},b={k:`insecure`,x:`proxy`,b:`cookie`,c:`cookie-jar`,E:`cert`,C:`continue-at`,N:`no-buffer`,A:`user-agent`};function x(){return{url:null,requestMethod:null,headers:[],data:[],form:[],get:!1,output:null,remoteName:!1,include:!1,head:!1,dumpHeader:null,writeOut:null,silent:!1,showError:!1,verbose:!1,failOnError:!1,maxTimeSeconds:null,credentials:`include`,tab:null,frame:null,user:null,referer:null,range:null,help:!1}}function S(e,t){return{message:`curlwright: option ${e} is not supported in a page context — ${y[t]}`,exitCode:2}}function C(e){return{message:`curlwright: unknown option ${e}\nRun 'curlwright --help' for the supported flags.`,exitCode:2}}function ee(e){let t=e.indexOf(`:`);if(t===-1)return e.endsWith(`;`)?{name:e.slice(0,-1).trim(),value:``,unset:!1}:{name:e.trim(),value:``,unset:!1};let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();return{name:n,value:r,unset:r===``}}function w(e,t,n,r){switch(t){case`request`:return e.requestMethod=n,null;case`header`:return e.headers.push(ee(n??``)),null;case`data`:case`data-ascii`:return e.data.push({kind:`ascii`,value:n??``}),null;case`data-raw`:return e.data.push({kind:`raw`,value:n??``}),null;case`data-binary`:return e.data.push({kind:`binary`,value:n??``}),null;case`data-urlencode`:return e.data.push({kind:`urlencode`,value:n??``}),null;case`json`:return e.data.push({kind:`json`,value:n??``}),null;case`form`:return e.form.push({value:n??``,literal:!1}),null;case`form-string`:return e.form.push({value:n??``,literal:!0}),null;case`output`:return e.output=n,null;case`dump-header`:return e.dumpHeader=n,null;case`write-out`:return e.writeOut=n,null;case`max-time`:return T(e,n,r);case`user`:return e.user=n,null;case`referer`:return e.referer=n,null;case`range`:return e.range=n,null;case`url`:return e.url=n,null;case`tab`:return e.tab=n,null;case`frame`:return e.frame=n,null;default:return E(e,t,r)}}function T(e,t,n){let r=Number(t);return!Number.isFinite(r)||r<=0?{message:`curlwright: ${n} expects a positive number of seconds`,exitCode:2}:(e.maxTimeSeconds=r,null)}function E(e,t,n){switch(t){case`silent`:return e.silent=!0,null;case`show-error`:return e.showError=!0,null;case`include`:return e.include=!0,null;case`head`:return e.head=!0,null;case`verbose`:return e.verbose=!0,null;case`fail`:return e.failOnError=!0,null;case`location`:return null;case`remote-name`:return e.remoteName=!0,null;case`get`:return e.get=!0,null;case`no-credentials`:return e.credentials=`omit`,null;case`help`:return e.help=!0,null;default:return C(n)}}function te(e,t,n){let r=t[n],i=r.indexOf(`=`),a=(i===-1?r.slice(2):r.slice(2,i)).trim(),o=i===-1?null:r.slice(i+1);if(a in y)return S(`--${a}`,a);if(h.has(a)){let r=o??t[n+1];return r===void 0?{message:`curlwright: option --${a} requires a value`,exitCode:2}:w(e,a,r,`--${a}`)??{next:o===null?n+2:n+1}}return g.has(a)?w(e,a,null,`--${a}`)??{next:n+1}:C(`--${a}`)}function ne(e,t,n){let r=t[n];for(let i=1;i<r.length;i++){let a=r[i];if(a in b)return S(`-${a}`,b[a]);if(a in _){let o=r.slice(i+1),s=o===``?t[n+1]:o;return s===void 0?{message:`curlwright: option -${a} requires a value`,exitCode:2}:w(e,_[a],s,`-${a}`)??{next:o===``?n+2:n+1}}if(!(a in v))return C(`-${a}`);let o=w(e,v[a],null,`-${a}`);if(o)return o}return{next:n+1}}function re(e,t){return e.url!==null&&e.url!==t?{message:`curlwright: only one URL is supported (got "${e.url}" and "${t}")`,exitCode:2}:(e.url=t,null)}function ie(e){let t=x(),n=0,r=!1;for(;n<e.length;){let i=e[n];if(!r&&i===`--`){r=!0,n++;continue}if(!r&&i.startsWith(`--`)){let r=te(t,e,n);if(`message`in r)return r;n=r.next;continue}if(!r&&i.startsWith(`-`)&&i.length>1){let r=ne(t,e,n);if(`message`in r)return r;n=r.next;continue}let a=re(t,i);if(a)return a;n++}return t}function ae(e){return`message`in e}const D={"accept-charset":`the browser sets it`,"accept-encoding":`the browser negotiates encoding`,connection:`the browser owns the connection`,"content-length":`derived from the body`,cookie:"the tab's cookies are sent already; set one with `playwright-cli cookie-set`",cookie2:`the tab's cookies are sent already`,date:`the browser sets it`,dnt:`the browser sets it`,expect:`a page fetch cannot send it`,host:`derived from the URL`,"keep-alive":`the browser owns the connection`,origin:`the tab's own origin is sent automatically`,referer:`use -e/--referer, which sets the fetch referrer`,te:`the browser owns transfer encoding`,trailer:`the browser owns transfer encoding`,"transfer-encoding":`the browser owns transfer encoding`,upgrade:`the browser owns the connection`,via:`the browser sets it`};function oe(e){let t=e.toLowerCase();return t in D?D[t]:t.startsWith(`proxy-`)?`proxying is configured on the browser`:t.startsWith(`sec-`)?`Sec- headers are reserved for the browser`:null}function O(e){for(let t of e){let e=oe(t.name);if(e)return{message:`curlwright: header "${t.name}" cannot be set from a page — ${e}`,exitCode:2}}return null}function k(e,t){let n=t.toLowerCase();return Object.keys(e).some(e=>e.toLowerCase()===n)}function A(e){let t={},n=new Set;for(let r of e.headers)if(r.name!==``){if(r.unset){n.add(r.name.toLowerCase());continue}t[r.name]=r.value}return{headers:t,suppressed:n}}function j(e,t,n){return!k(e,n)&&!t.has(n)}function M(e){return/^[a-zA-Z]+=/.test(e)?e:`bytes=${e}`}function N(e,t,n,r){n.user!==null&&j(e,t,`authorization`)&&(e.Authorization=`Basic ${btoa(n.user)}`),n.range!==null&&j(e,t,`range`)&&(e.Range=M(n.range)),r.contentType&&j(e,t,`content-type`)&&(e[`Content-Type`]=r.contentType),r.accept&&j(e,t,`accept`)&&(e.Accept=r.accept)}function P(e,t){if(t===``)return e;let[n,r]=F(e);return`${n}${n.includes(`?`)?`&`:`?`}${t}${r}`}function F(e){let t=e.indexOf(`#`);return t===-1?[e,``]:[e.slice(0,t),e.slice(t)]}function I(e,t){return e.requestMethod?e.requestMethod:e.head?`HEAD`:t?`POST`:`GET`}function L(e,t,n){let r=e.toUpperCase();return!t||r!==`GET`&&r!==`HEAD`?null:{message:`curlwright: ${n.requestMethod?`-X ${n.requestMethod}`:`-I`} cannot carry a request body — a page fetch rejects a ${r} with one. Drop the data, or use -G to send it as a query string.`,exitCode:2}}function R(e,t){if(e.url===null)return{message:`curlwright: no URL specified`,exitCode:2};let{headers:n,suppressed:r}=A(e),i=e.get&&t.bytes!==null,a=i?{...t,bytes:null,contentType:null}:t;N(n,r,e,a);let o=i?P(e.url,new TextDecoder().decode(t.bytes??new Uint8Array)):e.url,s=a.bytes!==null||a.form!==null,c=I(e,s),l=L(c,s,e);if(l)return l;let u={method:c,headers:n,credentials:e.credentials,responseType:`binary`};return a.form?u.body=a.form:a.bytes&&(u.body=a.bytes),e.referer!==null&&(u.referrer=e.referer),e.maxTimeSeconds!==null&&(u.timeoutMs=e.maxTimeSeconds*1e3),{url:o,method:c,fetchOptions:u,uploadSize:a.bytes?.length??0}}function z(e){let t=e.fetchOptions.headers??{},n=[`> ${e.method} ${e.url}`];for(let[e,r]of Object.entries(t))n.push(`> ${e}: ${r}`);return n.push(`> `),`${n.join(`
|
|
2
|
-
`)}\n`}function B(e,t){let n=[`< ${e}`];for(let[e,r]of Object.entries(t))n.push(`< ${e}: ${r}`);return n.push(`< `),`${n.join(`
|
|
3
|
-
`)}\n`}function V(t,n){return typeof t==`string`?n===`base64`?e(t):new TextEncoder().encode(t):new Uint8Array}function H(e,t){return t?`HTTP/1.1 ${e} ${t}`:`HTTP/1.1 ${e}`}function U(e,t,n){let r=[H(e,t)];for(let[e,t]of Object.entries(n))r.push(`${e}: ${t}`);return`${r.join(`\r
|
|
4
|
-
`)}\r\n\r\n`}function W(e){if(e.includes(0))return!0;try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(e),!1}catch{return!0}}function G(e){let t;try{t=new URL(e).pathname}catch{t=e.split(`?`)[0]}return t.replace(/\/+$/,``).split(`/`).pop()||null}function K(e,t,n){return new TextEncoder().encode(U(e,t,n)).length}function q(e){try{return new URL(e).origin}catch{return null}}function J(e){return e.map(e=>` --tab=${e.targetId} ${e.url}`).join(`
|
|
5
|
-
`)}async function se(e,n,r){if(r)return{targetId:r};let i;try{i=await t(e)}catch(e){return{message:`curlwright: cannot list tabs: ${e instanceof Error?e.message:e}`}}if(i.length===0)return{message:"curlwright: no open tabs — open one with `playwright-cli open <url>`"};let a=q(n),o=a?i.filter(e=>q(e.url)===a):[];return o.length===1?{targetId:o[0].targetId}:o.length>1?{message:`curlwright: ${o.length} open tabs are on ${a} — pass --tab to pick one.\n${J(o)}\n`}:i.length===1?{targetId:i[0].targetId}:{message:`curlwright: ${a?`no open tab is on ${a}`:`a relative URL needs an explicit tab`}, and several tabs are open — pass --tab.\n${J(i)}\n`}}function ce(e){return e.toFixed(6)}function le(e,t){switch(e){case`url`:case`url_effective`:return t.urlEffective;case`http_code`:case`response_code`:return String(t.httpCode);case`content_type`:return t.contentType;case`size_download`:return String(t.sizeDownload);case`size_header`:return String(t.sizeHeader);case`size_upload`:case`size_request`:return String(t.sizeUpload);case`method`:return t.method;case`num_redirects`:return String(t.numRedirects);case`time_total`:case`time_starttransfer`:return ce(t.timeTotalSeconds);case`exitcode`:return String(t.exitCode);case`errormsg`:return t.errorMsg;case`json`:return JSON.stringify(ue(t));default:return null}}function ue(e){return{url_effective:e.urlEffective,http_code:e.httpCode,content_type:e.contentType,size_download:e.sizeDownload,size_header:e.sizeHeader,size_upload:e.sizeUpload,method:e.method,num_redirects:e.numRedirects,time_total:e.timeTotalSeconds,exitcode:e.exitCode,errormsg:e.errorMsg}}function de(e,t){let n=e.toLowerCase();for(let[e,r]of Object.entries(t.responseHeaders))if(e.toLowerCase()===n)return r;return``}function fe(e){switch(e){case`n`:return`
|
|
6
|
-
`;case`r`:return`\r`;case`t`:return` `;default:return e}}function Y(e,t){let n=e.indexOf(`}`,t);return n===-1?null:{body:e.slice(t+1,n),end:n}}function pe(e,t){let n=[],r=``;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`&&i+1<e.length){r+=fe(e[++i]);continue}if(a!==`%`){r+=a;continue}if(e[i+1]===`%`){r+=`%`,i++;continue}if(e[i+1]===`{`){let o=Y(e,i+1);if(!o){r+=a;continue}let s=le(o.body,t);s===null&&n.push(`curlwright: unknown --write-out variable: '${o.body}'`),r+=s??``,i=o.end;continue}if(e.startsWith(`%header{`,i)){let n=Y(e,i+7);if(n){r+=de(n.body,t),i=n.end;continue}}r+=a}return{text:r,warnings:n}}function X(e,t){return{stdout:``,stderr:`${e}\n`,exitCode:t}}function me(e){let t=e instanceof Error?e.message:String(e);if(/TimeoutError|signal timed out|aborted/i.test(t)){let e=`Operation timed out`;return{message:`curlwright: (28) ${e}`,errorMsg:e,exitCode:28}}if(/Failed to fetch|NetworkError|TypeError/i.test(t)){let e=`Failed to fetch — ${t}`;return{message:`curlwright: (7) ${e}`,errorMsg:e,exitCode:7}}return{message:`curlwright: ${t}`,errorMsg:t,exitCode:1}}async function he(e,t,r,i,a){let o=await n(i,a);return await e.withTab(t,async()=>r?e.evaluateInFrame(r,o,{world:`main`}):e.evaluate(o))}async function Z(e,t,n){try{return await e.fs.writeFile(e.fs.resolvePath(e.cwd,t),n),null}catch(e){return`curlwright: (23) failed writing ${t}: ${e instanceof Error?e.message:e}`}}function ge(e,t){return e.output===null?e.remoteName?G(t)??{error:`curlwright: -O requires a URL with a file name in its path`}:null:e.output}async function Q(e,t,n,r,i){let a=ge(t,i);if(typeof a==`object`&&a)return n.messages+=`${a.error}\n`,2;if(a!==null&&a!==`-`){let t=await Z(e,a,r);return t?(n.messages+=`${t}\n`,23):0}return a===null&&W(r)?(n.messages+=`Warning: Binary output can mess up your terminal. Use "--output -" to tell
|
|
7
|
-
Warning: curlwright to output it to your terminal anyway, or consider
|
|
8
|
-
Warning: "--output <FILE>" to save to a file.
|
|
9
|
-
`,0):(n.stdout+=new TextDecoder().decode(r),0)}function $(e,t,n){if(e.writeOut===null)return;let r=pe(e.writeOut,n);t.stdout+=r.text;for(let e of r.warnings)t.messages+=`${e}\n`}function _e(e,t,n,r,i){return{urlEffective:t.url||e.url,httpCode:t.status,contentType:t.headers[`content-type`]??``,sizeDownload:n.length,sizeHeader:K(t.status,t.statusText,t.headers),sizeUpload:e.uploadSize,method:e.method,numRedirects:+!!t.redirected,timeTotalSeconds:r/1e3,exitCode:i,errorMsg:``,responseHeaders:t.headers}}function ve(e,t,n,r){return{urlEffective:e.url,httpCode:0,contentType:``,sizeDownload:0,sizeHeader:0,sizeUpload:e.uploadSize,method:e.method,numRedirects:0,timeTotalSeconds:t/1e3,exitCode:n,errorMsg:r,responseHeaders:{}}}async function ye(e,t,n,r,i){let a={stdout:``,trace:``,messages:``},o=H(r.status,r.statusText);t.verbose&&(a.trace+=B(o,r.headers)),(t.include||t.head)&&(a.stdout+=U(r.status,r.statusText,r.headers));let s=0;if(t.dumpHeader!==null){let n=U(r.status,r.statusText,r.headers),i=await Z(e,t.dumpHeader,new TextEncoder().encode(n));i&&(a.messages+=`${i}\n`,s=23)}let c=V(r.body,r.bodyEncoding),l=0;t.failOnError&&r.status>=400?(a.messages+=`curlwright: (22) The requested URL returned error: ${r.status}\n`,l=22):t.head||(l=await Q(e,t,a,c,n.url)),l===0&&(l=s),$(t,a,_e(n,r,c,i,l));let u=t.silent&&!t.showError;return{stdout:a.stdout,stderr:a.trace+(u?``:a.messages),exitCode:l}}async function be(e,t){let n=ie(t);if(ae(n))return X(n.message,n.exitCode);if(n.help)return{stdout:`curlwright — curl's arguments, executed inside a browser tab.
|
|
10
|
-
|
|
11
|
-
The request is issued by a page-context fetch(), so it carries that tab's
|
|
12
|
-
cookies, origin, TLS session and service-worker routing. Use it for an app's
|
|
13
|
-
own backend, where sandbox curl gets a 401/403/421.
|
|
14
|
-
|
|
15
|
-
Usage: curlwright [options] <url>
|
|
16
|
-
|
|
17
|
-
Request:
|
|
18
|
-
-X, --request <method> HTTP method (default GET, or POST with a body)
|
|
19
|
-
-H, --header <line> Add a header; repeatable. "Name;" sends it empty,
|
|
20
|
-
"Name:" suppresses a default curlwright would add
|
|
21
|
-
-d, --data <data> Request body; @file reads from the VFS
|
|
22
|
-
--data-raw <data> Body, with no @file expansion
|
|
23
|
-
--data-binary <data> Body; @file keeps newlines and raw bytes
|
|
24
|
-
--data-urlencode <d> URL-encode; content, =content, name=content, name@file
|
|
25
|
-
--json <data> Body + Content-Type/Accept: application/json
|
|
26
|
-
-F, --form <name=content> multipart/form-data; @file uploads, <file inlines
|
|
27
|
-
--form-string <n=c> multipart field, taken literally
|
|
28
|
-
-G, --get Send --data as a query string
|
|
29
|
-
-u, --user <user:pass> Basic auth (an Authorization header)
|
|
30
|
-
-e, --referer <url> Set the request referrer
|
|
31
|
-
-r, --range <range> Add a Range header ("0-499" becomes "bytes=0-499")
|
|
32
|
-
--no-credentials Do not send cookies (they are sent by default)
|
|
33
|
-
|
|
34
|
-
Tab selection:
|
|
35
|
-
--tab <targetId> Tab to run in. Without it: the tab on the URL's
|
|
36
|
-
origin when EXACTLY ONE matches, else the only
|
|
37
|
-
open tab. Two candidates is an error listing them
|
|
38
|
-
--frame <frameId> Run in a child frame of that tab
|
|
39
|
-
|
|
40
|
-
Output:
|
|
41
|
-
-o, --output <file> Write the body to a VFS file, byte-exact ("-" = stdout)
|
|
42
|
-
-O, --remote-name Write to the URL's last path segment
|
|
43
|
-
-i, --include Print response headers before the body
|
|
44
|
-
-I, --head Send HEAD and print only the headers
|
|
45
|
-
-D, --dump-header <file> Write the response headers to a file
|
|
46
|
-
-w, --write-out <format> Print a format string after the transfer
|
|
47
|
-
-s, --silent Suppress error messages
|
|
48
|
-
-S, --show-error Show errors even with -s
|
|
49
|
-
-v, --verbose Trace the request and response to stderr
|
|
50
|
-
-f, --fail No body on HTTP >= 400; exit 22
|
|
51
|
-
-m, --max-time <seconds> Abort the request after this long; exit 28
|
|
52
|
-
|
|
53
|
-
--write-out variables:
|
|
54
|
-
%{url_effective} %{http_code} %{content_type} %{size_download} %{size_header}
|
|
55
|
-
%{size_upload} %{method} %{num_redirects} %{time_total} %{exitcode}
|
|
56
|
-
%{errormsg} %{json}, %header{Name}, %% for a literal percent, \\n \\r \\t
|
|
57
|
-
|
|
58
|
-
Exit codes: 0 ok, 2 bad usage, 7 the fetch failed, 22 with --fail on HTTP >= 400,
|
|
59
|
-
23 write error, 26 cannot read an input file, 28 --max-time expired.
|
|
60
|
-
|
|
61
|
-
Notes:
|
|
62
|
-
- A body on GET or HEAD is rejected as bad usage (exit 2), because a page
|
|
63
|
-
fetch() cannot send one. Use -G to put the data in the query string.
|
|
64
|
-
- --write-out is rendered even when the transfer fails, so %{exitcode} and
|
|
65
|
-
%{errormsg} still reach stdout on a timeout or a network error.
|
|
66
|
-
- Redirects are ALWAYS followed: a page fetch cannot surface the intermediate
|
|
67
|
-
3xx, so -L is accepted and is already the behavior. %{num_redirects} is 0 or
|
|
68
|
-
1 — "at least one hop" — because the page context cannot count them.
|
|
69
|
-
- Cross-origin responses expose only CORS-safelisted headers unless the server
|
|
70
|
-
sends Access-Control-Expose-Headers. Same-origin requests see all of them.
|
|
71
|
-
- Options a page cannot honor (--cert, --insecure, -x, --resolve, --compressed,
|
|
72
|
-
-b, -A, ...) are rejected by name rather than ignored.
|
|
73
|
-
|
|
74
|
-
Examples:
|
|
75
|
-
curlwright -s https://app.example.com/api/me
|
|
76
|
-
curlwright -X POST https://app.example.com/api/items \\
|
|
77
|
-
-H 'X-CSRF-Token: abc' -d '{"name":"x"}' --tab <targetId>
|
|
78
|
-
curlwright -o /tmp/deck.key https://p27-iwres.icloud.com/iwmb/keynote/.../fetchDocument
|
|
79
|
-
curlwright -o /tmp/me.json -w '%{http_code} %{size_download}\\n' https://app.example.com/api/me
|
|
80
|
-
`,stderr:``,exitCode:0};if(n.url===null)return X(`curlwright: no URL specified`,2);let r=O(n.headers);if(r)return X(r.message,r.exitCode);let i=await m(e,n.data,n.form);if(`exitCode`in i)return X(i.message,i.exitCode);let a=R(n,i);return`message`in a?X(a.message,a.exitCode):{opts:n,request:a}}async function xe(e,t,n){if(t.length===0)return X(`curlwright: no URL specified
|
|
81
|
-
Run 'curlwright --help' for usage.`,2);let r=await be(n,t);if(`exitCode`in r)return r;let{opts:i,request:a}=r;if(!e)return X(`curlwright: browser APIs are unavailable in this environment`,1);let o=await se(e,a.url,i.tab);if(`message`in o)return X(o.message,2);let s=i.verbose?z(a):``,c=Date.now(),l;try{l=await he(e,o.targetId,i.frame,a.url,a.fetchOptions)}catch(e){let t=me(e),n={stdout:``,trace:s,messages:`${t.message}\n`};$(i,n,ve(a,Date.now()-c,t.exitCode,t.errorMsg));let r=i.silent&&!i.showError;return{stdout:n.stdout,stderr:n.trace+(r?``:n.messages),exitCode:t.exitCode}}let u=await ye(n,i,a,l,Date.now()-c);return{...u,stderr:s+u.stderr}}export{xe as runCurlwright};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./float-topology-DiK91BlA.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./mime-types-ugOWOUZ9.js";import{n}from"./runtime-env-Dlaokqg1.js";import"./fetch-body-D2PwksUW.js";import"./runtime-env-E-i2SW1s.js";var r=`20.0.0`,i=new Set([`child_process`,`events`,`fs`,`fs/promises`,`os`,`path`,`stream`,`tty`,`url`,`crypto`,`process`,`buffer`,`assert`,`assert/strict`,`util`,`readline`,`readline/promises`]);new Set([...new Set(`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib`.split(`.`))].filter(e=>!i.has(e)));var a=`/shared/lib`;`${a}`,`${a}`,[`unpkg`,`com`].join(`.`),[`cdn`,`jsdelivr`,`net`].join(`.`),[`registry`,`npmjs`,`org`].join(`.`);var o=e(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),s=e(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),c=e(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=o(),a=s();e=t.exports={};var c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.safeSrc=[],f=e.t={},p=0,m=`[a-zA-Z0-9-]`,h=[[`\\s`,1],[`\\d`,i],[m,r]],g=e=>{for(let[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},_=(e,t,n)=>{let r=g(t),i=p++;a(e,i,t),f[e]=i,u[i]=t,d[i]=r,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};_(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),_(`NUMERICIDENTIFIERLOOSE`,`\\d+`),_(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${m}*`),_(`MAINVERSION`,`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),_(`MAINVERSIONLOOSE`,`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASEIDENTIFIER`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),_(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASE`,`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),_(`PRERELEASELOOSE`,`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),_(`BUILDIDENTIFIER`,`${m}+`),_(`BUILD`,`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),_(`FULLPLAIN`,`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),_(`FULL`,`^${u[f.FULLPLAIN]}$`),_(`LOOSEPLAIN`,`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),_(`LOOSE`,`^${u[f.LOOSEPLAIN]}$`),_(`GTLT`,`((?:<|>)?=?)`),_(`XRANGEIDENTIFIERLOOSE`,`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_(`XRANGEIDENTIFIER`,`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),_(`XRANGEPLAIN`,`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),_(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),_(`XRANGE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),_(`XRANGELOOSE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),_(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),_(`COERCE`,`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),_(`COERCEFULL`,u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?(?:${u[f.BUILD]})?(?:$|[^\\d])`),_(`COERCERTL`,u[f.COERCE],!0),_(`COERCERTLFULL`,u[f.COERCEFULL],!0),_(`LONETILDE`,`(?:~>?)`),_(`TILDETRIM`,`(\\s*)${u[f.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,_(`TILDE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),_(`TILDELOOSE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),_(`LONECARET`,`(?:\\^)`),_(`CARETTRIM`,`(\\s*)${u[f.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,_(`CARET`,`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),_(`CARETLOOSE`,`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),_(`COMPARATORLOOSE`,`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),_(`COMPARATOR`,`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),_(`COMPARATORTRIM`,`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,_(`HYPHENRANGE`,`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),_(`HYPHENRANGELOOSE`,`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),_(`STAR`,`(<|>)?=?\\s*\\*`),_(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),_(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),l=e(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),u=e(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),d=e(((e,t)=>{var n=s(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=o(),{safeRe:a,t:d}=c(),f=l(),{compareIdentifiers:p}=u(),m=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(p(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,o){if(o=f(o),t instanceof e){if(t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;let s=t.trim().match(o.loose?a[d.LOOSE]:a[d.FULL]);if(!s)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=s[4]?s[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):[],this.build=s[5]?s[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[d.PRERELEASELOOSE]:a[d.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),m(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),f=e(((e,t)=>{var n=d();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),p=e(((e,t)=>{var n=f();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),m=e(((e,t)=>{var n=f();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),h=e(((e,t)=>{var n=d();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),g=e(((e,t)=>{var n=f();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),_=e(((e,t)=>{var n=d();t.exports=(e,t)=>new n(e,t).major})),v=e(((e,t)=>{var n=d();t.exports=(e,t)=>new n(e,t).minor})),y=e(((e,t)=>{var n=d();t.exports=(e,t)=>new n(e,t).patch})),b=e(((e,t)=>{var n=f();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),x=e(((e,t)=>{var n=d();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),S=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(t,e,r)})),C=e(((e,t)=>{var n=x();t.exports=(e,t)=>n(e,t,!0)})),w=e(((e,t)=>{var n=d();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),T=e(((e,t)=>{var n=w();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),E=e(((e,t)=>{var n=w();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),D=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(e,t,r)>0})),O=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(e,t,r)<0})),k=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(e,t,r)===0})),A=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(e,t,r)!==0})),j=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(e,t,r)>=0})),M=e(((e,t)=>{var n=x();t.exports=(e,t,r)=>n(e,t,r)<=0})),N=e(((e,t)=>{var n=k(),r=A(),i=D(),a=j(),o=O(),s=M();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),P=e(((e,t)=>{var n=d(),r=f(),{safeRe:i,t:a}=c();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let o=null;if(!t.rtl)o=e.match(t.includePrerelease?i[a.COERCEFULL]:i[a.COERCE]);else{let n=t.includePrerelease?i[a.COERCERTLFULL]:i[a.COERCERTL],r;for(;(r=n.exec(e))&&(!o||o.index+o[0].length!==e.length);)(!o||r.index+r[0].length!==o.index+o[0].length)&&(o=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(o===null)return null;let s=o[2];return r(`${s}.${o[3]||`0`}.${o[4]||`0`}${t.includePrerelease&&o[5]?`-${o[5]}`:``}${t.includePrerelease&&o[6]?`+${o[6]}`:``}`,t)}})),F=e(((e,t)=>{var n=f(),r=o(),i=d(),a=(e,t,n)=>{if(!r.RELEASE_TYPES.includes(t))return null;let i=s(e,n);return i&&c(i,t)},s=(e,t)=>n(e instanceof i?e.version:e,t),c=(e,t)=>{if(l(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},l=e=>e.startsWith(`pre`);t.exports=a})),I=e(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),L=e(((e,t)=>{var n=/\s+/g;t.exports=class e{constructor(t,r){if(r=i(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof a)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!S(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&C(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(x,``);let t=((this.options.includePrerelease&&y)|(this.options.loose&&b))+`:`+e,n=r.get(t);if(n)return n;let i=this.options.loose,o=i?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];e=e.replace(o,L(this.options.includePrerelease)),u(`hyphen replace`,e),e=e.replace(p[h.COMPARATORTRIM],g),u(`comparator trim`,e),e=e.replace(p[h.TILDETRIM],_),u(`tilde trim`,e),e=e.replace(p[h.CARETTRIM],v),u(`caret trim`,e);let s=e.split(` `).map(e=>T(e,this.options)).join(` `).split(/\s+/).map(e=>F(e,this.options));i&&(s=s.filter(e=>(u(`loose invalid filter`,e,this.options),!!e.match(p[h.COMPARATORLOOSE])))),u(`range list`,s);let c=new Map,l=s.map(e=>new a(e,this.options));for(let e of l){if(S(e))return[e];c.set(e.value,e)}c.size>1&&c.has(``)&&c.delete(``);let d=[...c.values()];return r.set(t,d),d}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>w(e,n)&&t.set.some(t=>w(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(z(this.set[t],e,this.options))return!0;return!1}};var r=new(I()),i=l(),a=R(),u=s(),f=d(),{safeRe:p,src:m,t:h,comparatorTrimReplace:g,tildeTrimReplace:_,caretTrimReplace:v}=c(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:b}=o(),x=new RegExp(m[h.BUILD],`g`),S=e=>e.value===`<0.0.0-0`,C=e=>e.value===``,w=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},T=(e,t)=>(e=e.replace(p[h.BUILD],``),u(`comp`,e,t),e=A(e,t),u(`caret`,e),e=O(e,t),u(`tildes`,e),e=M(e,t),u(`xrange`,e),e=P(e,t),u(`stars`,e),e),E=e=>!e||e.toLowerCase()===`x`||e===`*`,D=(e,t,n)=>E(e)&&!E(t)||E(t)&&n&&!E(n),O=(e,t)=>e.trim().split(/\s+/).map(e=>k(e,t)).join(` `),k=(e,t)=>{let n=t.loose?p[h.TILDELOOSE]:p[h.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{u(`tilde`,e,t,n,i,a,o);let s;return E(n)?s=``:E(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(a)?s=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:o?(u(`replaceTilde pr`,o),s=`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,u(`tilde return`,s),s})},A=(e,t)=>e.trim().split(/\s+/).map(e=>j(e,t)).join(` `),j=(e,t)=>{u(`caret`,e,t);let n=t.loose?p[h.CARETLOOSE]:p[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{u(`caret`,e,t,n,i,a,o);let s;return E(n)?s=``:E(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(u(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(u(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),u(`caret return`,s),s})},M=(e,t)=>(u(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>N(e,t)).join(` `)),N=(e,t)=>{e=e.trim();let n=t.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{if(u(`xRange`,e,n,r,i,a,o,s),D(i,a,o))return e;let c=E(i),l=c||E(a),d=l||E(o),f=d;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),u(`xRange return`,n),n})},P=(e,t)=>(u(`replaceStars`,e,t),e.trim().replace(p[h.STAR],``)),F=(e,t)=>(u(`replaceGTE0`,e,t),e.trim().replace(p[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),L=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=E(r)?``:E(i)?`>=${r}.0.0${e?`-0`:``}`:E(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=E(l)?``:E(u)?`<${+l+1}.0.0-0`:E(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),z=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(u(e[n].semver),e[n].semver!==a.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),R=e(((e,t)=>{var n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),u(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,u(`comp`,this)}parse(e){let t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new f(r[2],this.options.loose):n}toString(){return this.value}test(e){if(u(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return o(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||o(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||o(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var r=l(),{safeRe:i,t:a}=c(),o=N(),u=s(),f=d(),p=L()})),z=e(((e,t)=>{var n=L();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),B=e(((e,t)=>{var n=L();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),V=e(((e,t)=>{var n=d(),r=L();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===-1)&&(a=e,o=new n(a,i))}),a}})),H=e(((e,t)=>{var n=d(),r=L();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(!a||o.compare(e)===1)&&(a=e,o=new n(a,i))}),a}})),U=e(((e,t)=>{var n=d(),r=L(),i=D();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),W=e(((e,t)=>{var n=L();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),G=e(((e,t)=>{var n=d(),r=R(),{ANY:i}=r,a=L(),o=z(),s=D(),c=O(),l=M(),u=j();t.exports=(e,t,d,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(d){case`>`:p=s,m=l,h=c,g=`>`,_=`>=`;break;case`<`:p=c,m=u,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),K=e(((e,t)=>{var n=G();t.exports=(e,t,r)=>n(e,t,`>`,r)})),q=e(((e,t)=>{var n=G();t.exports=(e,t,r)=>n(e,t,`<`,r)})),J=e(((e,t)=>{var n=L();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),Y=e(((e,t)=>{var n=z(),r=x();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),X=e(((e,t)=>{var n=L(),r=R(),{ANY:i}=r,a=z(),o=x(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s}));e(((e,t)=>{var n=c(),r=o(),i=d(),a=u();t.exports={parse:f(),valid:p(),clean:m(),inc:h(),diff:g(),major:_(),minor:v(),patch:y(),prerelease:b(),compare:x(),rcompare:S(),compareLoose:C(),compareBuild:w(),sort:T(),rsort:E(),gt:D(),lt:O(),eq:k(),neq:A(),gte:j(),lte:M(),cmp:N(),coerce:P(),truncate:F(),Comparator:R(),Range:L(),satisfies:z(),toComparators:B(),maxSatisfying:V(),minSatisfying:H(),minVersion:U(),validRange:W(),outside:G(),gtr:K(),ltr:q(),intersects:J(),simplifyRange:Y(),subset:X(),SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}}))();var Z=`ipk add -g`,Q=`typescript@6.0.3`,$=`${Z} ${Q}`;`${Q}`,`${r}`;function ee(e){return t(e)}function te(e,t){let r=n(),i=`/preview${e}${t?`?projectRoot=${encodeURIComponent(t)}`:``}`;if(r)return chrome.runtime.getURL(i);let a=`http://localhost:5710`;return typeof window<`u`&&window.location?.origin?a=window.location.origin:typeof self<`u`&&self.location?.origin&&(a=self.location.origin),`${a}${i}`}`${$}`;export{te as n,ee as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./fs-DXCuzgSg.js";export{t as repairOpfsMetadataSidecar,e as resolveWithSidecarRepair};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return{version:`6.103.0`,releasedAt:`2026-08-27T15:23:39Z`,buildId:`6.103.0-mtboaf3l`}}let t=null;function n(e){t=e}function r(){return t}export{e as n,n as r,r as t};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import"./logger-DQgFbfwx.js";import{n as t}from"./panel-rpc-BPwAqRch.js";import{a as n}from"./proxied-fetch-Co-pb0x0.js";import"./src-CcFD5QfS.js";import{t as r}from"./types-idfTVsM8.js";import"./tray-runtime-config-CVoPQrT2.js";import"./fs-C3c6w9-a.js";function i(e){return e==null?[]:Array.isArray(e)?e:[e]}function a(e,t,n,r){var i,a=e[t],o=~r.string.indexOf(t)?n==null||n===!0?``:String(n):typeof n==`boolean`?n:~r.boolean.indexOf(t)?n===`false`?!1:n===`true`||(e._.push((i=+n,i*0==0?i:n)),!!n):(i=+n,i*0==0?i:n);e[t]=a==null?o:Array.isArray(a)?a.concat(o):[a,o]}function o(e,t){e||=[],t||={};var n,r,o,s,c,l={_:[]},u=0,d=0,f=0,p=e.length;let m=t.alias!==void 0,h=t.unknown!==void 0,g=t.default!==void 0;if(t.alias=t.alias||{},t.string=i(t.string),t.boolean=i(t.boolean),m)for(n in t.alias)for(r=t.alias[n]=i(t.alias[n]),u=0;u<r.length;u++)(t.alias[r[u]]=r.concat(n)).splice(u,1);for(u=t.boolean.length;u-->0;)for(r=t.alias[t.boolean[u]]||[],d=r.length;d-->0;)t.boolean.push(r[d]);for(u=t.string.length;u-->0;)for(r=t.alias[t.string[u]]||[],d=r.length;d-->0;)t.string.push(r[d]);if(g){for(n in t.default)if(s=typeof t.default[n],r=t.alias[n]=t.alias[n]||[],t[s]!==void 0)for(t[s].push(n),u=0;u<r.length;u++)t[s].push(r[u])}let _=h?Object.keys(t.alias):[];for(u=0;u<p;u++){if(o=e[u],o===`--`){l._=l._.concat(e.slice(++u));break}for(d=0;d<o.length&&o.charCodeAt(d)===45;d++);if(d===0)l._.push(o);else if(o.substring(d,d+3)===`no-`){if(s=o.substring(d+3),h&&!~_.indexOf(s))return t.unknown(o);l[s]=!1}else{for(f=d+1;f<o.length&&o.charCodeAt(f)!==61;f++);for(s=o.substring(d,f),c=o.substring(++f)||u+1===p||(``+e[u+1]).charCodeAt(0)===45||e[++u],r=d===2?[s]:s,f=0;f<r.length;f++){if(s=r[f],h&&!~_.indexOf(s))return t.unknown(`-`.repeat(d)+s);a(l,s,f+1<r.length||c,t)}}}if(g)for(n in t.default)l[n]===void 0&&(l[n]=t.default[n]);if(m)for(n in l)for(r=t.alias[n]||[];r.length>0;)l[r.shift()]=l[n];return l}function s(e,t){let n=[],r=new Map,i=new Set;for(let a=0;a<e.length;a++){let o=e[a];o.startsWith(`-`)?t.has(o)?r.set(o,e[++a]??``):i.add(o):n.push(o)}return{positionals:n,flags:r,bools:i}}function c(e){let t=new Set(e.string??[]),n=e.alias??{};for(let[e,r]of Object.entries(n)){let n=[e,...Array.isArray(r)?r:[r]];if(n.some(e=>t.has(e)))for(let e of n)t.add(e)}return t}const l=/^(--?)([^=]+)(=.*)?$/;function u(e){let t=new Set(e.string??[]);for(let n of e.boolean??[])t.add(n),t.add(`no-${n}`);for(let[n,r]of Object.entries(e.alias??{})){t.add(n);for(let e of Array.isArray(r)?r:[r])t.add(e)}return t}function d(e,t,n){let r=0;for(;r<e.length;r++){let i=e[r];if(!i.startsWith(`-`)||i===`-`)break;let a=l.exec(i);if(!a||!n.has(a[2]))break;!a[3]&&t.has(a[2])&&r+1<e.length&&r++}return r}function f(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=l.exec(i);a&&!a[3]&&t.has(a[2])&&r+1<e.length?(n.push(`${i}=${e[r+1]}`),r++):n.push(i)}return n}function p(e,t={}){let n=e,r=[];if(t[`--`]){let t=e.indexOf(`--`);t!==-1&&(n=e.slice(0,t),r=e.slice(t+1))}let i=c(t),a=n,s=[];if(t.stopEarly){let e=d(n,i,u(t));a=n.slice(0,e),s=n.slice(e)}let{_:l,...p}=o(f(a,i),{string:t.string?[...t.string]:void 0,boolean:t.boolean?[...t.boolean]:void 0,alias:t.alias,default:t.default}),m=t.stopEarly?s:l;return{_:m,positionals:m,flags:p,doubleDashRest:r}}function m(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...Array.from(e.subarray(r,r+n)));return btoa(t)}async function h(e){let t=[];for(let[n,r]of e.entries()){if(typeof r==`string`){t.push({name:n,value:r});continue}let e=new Uint8Array(await r.arrayBuffer());t.push({name:n,file:{data:m(e),filename:typeof r.name==`string`?r.name:`blob`,type:r.type||``}})}return{kind:`formdata`,entries:t}}async function g(e,t){let n=()=>Object.keys(t).some(e=>e.toLowerCase()===`content-type`);return typeof e==`string`?{body:e}:e instanceof URLSearchParams?(n()||(t[`Content-Type`]=`application/x-www-form-urlencoded;charset=UTF-8`),{body:e.toString()}):e instanceof Blob?{descriptor:{kind:`blob`,data:m(new Uint8Array(await e.arrayBuffer())),type:e.type||``}}:e instanceof ArrayBuffer?{descriptor:{kind:`bytes`,data:m(new Uint8Array(e))}}:ArrayBuffer.isView(e)?{descriptor:{kind:`bytes`,data:m(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}}:e instanceof FormData?{descriptor:await h(e)}:(n()||(t[`Content-Type`]=`application/json`),{body:JSON.stringify(e)})}function _(e){return e?`const __b64 = (s) => { const bin = atob(s); const n = bin.length; const u = new Uint8Array(n); for (let i = 0; i < n; i++) u[i] = bin.charCodeAt(i); return u; };const __body = `+JSON.stringify(e)+`;if (__body.kind === 'bytes') { __init.body = __b64(__body.data); }else if (__body.kind === 'blob') { __init.body = new Blob([__b64(__body.data)], { type: __body.type }); }else if (__body.kind === 'formdata') { const __fd = new FormData(); for (const e of __body.entries) { if (e.file) { __fd.append(e.name, new Blob([__b64(e.file.data)], { type: e.file.type }), e.file.filename); } else { __fd.append(e.name, e.value); } } __init.body = __fd; }`:``}function v(e){return`const h = {};r.headers.forEach((v, k) => { h[k] = v; });const ct = r.headers.get('content-type') || '';const __rt = `+JSON.stringify(e??null)+`;const __ctl = ct.toLowerCase();const __binPrefixes = ['image/','audio/','video/','application/octet-stream','application/pdf','application/protobuf','application/x-protobuf','application/wasm','application/zip'];const __isXml = __ctl.indexOf('+xml') !== -1 || __ctl.indexOf('application/xml') === 0 || __ctl.indexOf('text/xml') === 0;const __isBinary = __rt === 'binary' || (__rt !== 'text' && __rt !== 'json' && !__isXml && __binPrefixes.some((p) => __ctl.indexOf(p) === 0));const __meta = { ok: r.ok, status: r.status, statusText: r.statusText, url: r.url, redirected: !!r.redirected, headers: h };if (__isBinary) {const __u = new Uint8Array(await r.arrayBuffer());let __s = ''; const __cs = 0x8000;for (let __i = 0; __i < __u.length; __i += __cs) { __s += String.fromCharCode.apply(null, __u.subarray(__i, __i + __cs)); }return Object.assign(__meta, { body: btoa(__s), bodyEncoding: 'base64' });}const t = await r.text();let b;const __jsonWanted = __rt === 'json' || (__rt !== 'text' && ct.indexOf('application/json') !== -1);if (__jsonWanted) { if (!t) { b = null; } else { try { b = JSON.parse(t); } catch (e) { b = t; } } }else { b = t; }return Object.assign(__meta, { body: b });`}async function y(e,t={}){let n={},r=t.headers??{};for(let[e,t]of Object.entries(r))typeof t==`string`&&(n[e]=t);let i=typeof t.method==`string`?t.method:`GET`,a=t.credentials===`same-origin`||t.credentials===`omit`?t.credentials:`include`,o=t.body,{body:s,descriptor:c}=o==null?{}:await g(o,n),l={method:i,credentials:a,headers:n};s!==void 0&&(l.body=s),t.mode!==void 0&&(l.mode=t.mode),t.cache!==void 0&&(l.cache=t.cache),t.redirect!==void 0&&(l.redirect=t.redirect),t.referrer!==void 0&&(l.referrer=t.referrer),t.referrerPolicy!==void 0&&(l.referrerPolicy=t.referrerPolicy),t.integrity!==void 0&&(l.integrity=t.integrity),t.keepalive!==void 0&&(l.keepalive=t.keepalive);let u=_(c),d=v(t.responseType),f=typeof t.timeoutMs==`number`&&Number.isFinite(t.timeoutMs)&&t.timeoutMs>0?Math.round(t.timeoutMs):0,p=f>0?`__init.signal = AbortSignal.timeout(${f});`:``;return`(async () => {const __init = `+JSON.stringify(l)+`;`+p+u+`const r = await fetch(`+JSON.stringify(e)+`, __init);`+d+`})()`}const b=[`playwright-cli`,`playwright`,`puppeteer`],x=new WeakMap,S=e(`playwright`);function C(e,t){let n=x.get(e);n||(n=new WeakMap,x.set(e,n));let r=n.get(t);return r||(r={snapshots:new Map,appTabId:null,harRecorder:null,sessionDirsCreated:!1,teleportWatchers:new Map,consoleMessages:new Map,consoleCleanup:new Map,networkRequests:new Map,networkRequestIndex:new Map,networkCleanup:new Map,routes:new Map,routeCleanup:new Map,lastMousePosition:new Map},n.set(t,r)),r}function w(e){let t=e.match(/^(f[0-9]+)(e[0-9]+)$/);return t?{framePrefix:t[1],isIframe:!0}:{framePrefix:``,isIframe:!1}}const T=n,E=new Set([`click`,`dblclick`,`fill`,`type`,`press`,`goto`,`navigate`,`select`,`check`,`uncheck`,`drag`,`dialog-accept`,`dialog-dismiss`,`drop`]);function D(e){return e.toISOString().replace(/:/g,`-`)}function O(e){return e instanceof r||typeof e==`object`&&e&&`code`in e?e.code===`EEXIST`:e instanceof Error&&e.message.includes(`EEXIST`)}const k=`function(text) {
|
|
2
|
-
const el = this;
|
|
3
|
-
const tag = el.tagName;
|
|
4
|
-
const proto = tag === 'TEXTAREA' ? window.HTMLTextAreaElement.prototype : window.HTMLInputElement.prototype;
|
|
5
|
-
const nativeSetter = Object.getOwnPropertyDescriptor(proto, 'value')?.set;
|
|
6
|
-
if (nativeSetter) {
|
|
7
|
-
nativeSetter.call(el, text);
|
|
8
|
-
} else {
|
|
9
|
-
el.value = text;
|
|
10
|
-
}
|
|
11
|
-
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
12
|
-
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
13
|
-
}`,A=`function() {
|
|
14
|
-
const el = this;
|
|
15
|
-
if (el.isContentEditable) return el.textContent || '';
|
|
16
|
-
return el.value ?? '';
|
|
17
|
-
}`,j=`function() {
|
|
18
|
-
const el = this;
|
|
19
|
-
if (!(el instanceof HTMLElement)) return false;
|
|
20
|
-
el.focus();
|
|
21
|
-
const emitInput = () => el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
22
|
-
if (el.isContentEditable) {
|
|
23
|
-
el.textContent = '';
|
|
24
|
-
const selection = window.getSelection();
|
|
25
|
-
if (selection) {
|
|
26
|
-
const range = document.createRange();
|
|
27
|
-
range.selectNodeContents(el);
|
|
28
|
-
range.collapse(false);
|
|
29
|
-
selection.removeAllRanges();
|
|
30
|
-
selection.addRange(range);
|
|
31
|
-
}
|
|
32
|
-
emitInput();
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement || 'value' in el) {
|
|
36
|
-
el.value = '';
|
|
37
|
-
emitInput();
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
}`;async function M(e){let t=await e.evaluate(`JSON.stringify({ href: location.href, hostname: location.hostname, pathname: location.pathname })`);return JSON.parse(t)}const N={string:`tab.frame.filename.max-width.runtime.timeout.filter.output.start.return.teleport-start.teleport-return.teleport-runtime.domain.path.expires.method.depth.modifiers.sameSite.data.status.body.content-type.header.style`.split(`.`),boolean:[`boxes`,`clear`,`discover`,`foreground`,`fg`,`full-page`,`fullPage`,`hide`,`httpOnly`,`list`,`off`,`secure`,`static`,`submit`],alias:{foreground:`fg`,"full-page":`fullPage`}};function P(e){let t=p(e.map(e=>e===`--no-iframes`||e.startsWith(`--no-iframes=`)?e.replace(`--no-iframes`,`--_noiframes`):e),N),n={};for(let[e,r]of Object.entries(t.flags)){let t=e===`_noiframes`?`no-iframes`:e;if(r===!0)n[t]=`true`;else if(r===!1)continue;else r!==void 0&&(n[t]=String(r))}return{positional:t.positionals,flags:n}}function F(e){let t=e.tab;return t?{targetId:t}:{error:`Error: --tab <targetId> is required. Run 'playwright-cli tab-list' to get tab IDs.
|
|
42
|
-
`}}async function I(e,t){let n=t.frame;if(!n)return null;let r=(await e.getFrameTree()).find(e=>e.frameId===n);if(r)return r;let i=t.tab??`<targetId>`;throw Error(`Unknown frame ID "${n}" for tab ${i}. Run 'playwright-cli frames --tab=${i}' to list frame IDs.`)}function L(){try{let e=globalThis.localStorage;return e?!!(e.getItem(`slicc.trayWorkerBaseUrl`)||e.getItem(`slicc.trayJoinUrl`)):!1}catch{return!1}}async function R(e){if(typeof e.listAllTargets!=`function`)return e.listPages();let n=await e.listAllTargets(),r=L()?t():null;if(!r)return n;try{let{targets:e}=await r.call(`list-remote-targets`,void 0,{timeoutMs:3e3}),t=new Set(n.map(e=>e.targetId));for(let r of e)t.has(r.targetId)||(t.add(r.targetId),n.push({targetId:r.targetId,title:r.title,url:r.url}))}catch(e){S.debug(`panel-rpc list-remote-targets failed`,{err:String(e)})}return n}async function z(e){try{return await R(e)}catch{return[]}}async function B(e,t,n){if(!(n instanceof Error?n.message:String(n)).includes(`No target with given id found`))return null;for(let n of await z(e))try{if((await e.withTab(n.targetId,async()=>e.getFrameTree())).some(e=>e.frameId===t))return`"${t}" is a frame ID, not a tab target ID. Use --tab=${n.targetId} --frame=${t}; run 'playwright-cli frames --tab=${n.targetId}' to list frame IDs.`}catch{}return null}export{I as _,k as a,s as b,D as c,C as d,O as f,F as g,w as h,N as i,B as l,P as m,j as n,A as o,R as p,b as r,T as s,E as t,M as u,y as v,p as y};
|