sliccy 6.232.3 → 6.233.1
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 +2 -2
- package/dist/node-server/chrome-launch.d.ts +2 -0
- package/dist/node-server/chrome-launch.js +11 -1
- package/dist/node-server/index.js +1 -0
- package/dist/ui/.vite/manifest.json +282 -278
- package/dist/ui/assets/{SKILL-DfQfFV0B.js → SKILL-BcBnRJhU.js} +1 -1
- package/dist/ui/assets/{SKILL-CDWYTQKl.js → SKILL-BsfbaE8W.js} +1 -1
- package/dist/ui/assets/SKILL-Dk6kide7.js +1 -0
- package/dist/ui/assets/account-store-BGptY10e.js +1 -0
- package/dist/ui/assets/account-store-DiRMol3Q.js +2 -0
- package/dist/ui/assets/adobe-0-GN_JoC.js +2 -0
- package/dist/ui/assets/adobe-C5m6iBnw.js +1 -0
- package/dist/ui/assets/agent-help-B-gfDDn0.js +103 -0
- package/dist/ui/assets/agent-images-DaBj3QYk.js +3 -0
- package/dist/ui/assets/{agent-panels-cs_l6Y3W.js → agent-panels-DSSejQNd.js} +1 -1
- package/dist/ui/assets/{agent-tools-BzWhYeEw.js → agent-tools-WbCq5rUh.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-B82NrHyV.js → almost-bash-shell-headless-DokddEN1.js} +91 -175
- package/dist/ui/assets/{apply-layout-DHjJQg3o.js → apply-layout-BnGFAeHm.js} +1 -1
- package/dist/ui/assets/{apps-CsJCa1W4.js → apps-CyIXX0a_.js} +1 -1
- package/dist/ui/assets/{azure-openai-DBSL3940.js → azure-openai-DXS5rPbd.js} +1 -1
- package/dist/ui/assets/{azure-openai-0xShokH8.js → azure-openai-PyZ816ly.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-DAjlRr0I.js → backend-hostfs-DmMZ1Vnt.js} +1 -1
- package/dist/ui/assets/{capability-BsxMoeMg.js → capability-6V-AYPSJ.js} +2 -2
- package/dist/ui/assets/{cdp-bOHrUn4t.js → cdp-BppspuSz.js} +1 -1
- package/dist/ui/assets/{cerebras-Sczc8yWr.js → cerebras-BeROsc2d.js} +1 -1
- package/dist/ui/assets/{cerebras-CJtdoZMJ.js → cerebras-CVnpQN6i.js} +1 -1
- package/dist/ui/assets/{client-DWx5wn8j.js → client-D5zdJCVT.js} +1 -1
- package/dist/ui/assets/{codemode-tool-BH0jhnKf.js → codemode-tool-FcP24sWd.js} +1 -1
- package/dist/ui/assets/{composer-speech-Dt5JE2sh.js → composer-speech-HZyA7vHh.js} +1 -1
- package/dist/ui/assets/{connect-surface-BO_rHeDZ.js → connect-surface-is2QooP6.js} +1 -1
- package/dist/ui/assets/{connection-manager-E3P4E4Le.js → connection-manager-D0LxHiWb.js} +1 -1
- package/dist/ui/assets/core-C1m4D34S.js +36 -0
- package/dist/ui/assets/{core-4boN-CgI.js → core-Cx9N3lmn.js} +1 -1
- package/dist/ui/assets/{cost-command-C_1fldSP.js → cost-command-BUgEVZCe.js} +8 -1
- package/dist/ui/assets/{directed-approval-Dig9vgFX.js → directed-approval-BL1_1yFr.js} +1 -1
- package/dist/ui/assets/{discovery-preference-D1cUzn0M.js → discovery-preference-D8GXCv8i.js} +1 -1
- package/dist/ui/assets/emscripten-vfs-hook-D1Wo4S_o.js +1 -0
- package/dist/ui/assets/{emscripten-vfs-hook-BJh0QvlC.js → emscripten-vfs-hook-D4rVkB6b.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-BQperrcM.js → ensure-speech-assets-CB-6d53s.js} +1 -1
- package/dist/ui/assets/{extension-ops-Ded2__AC.js → extension-ops-OtrqWANJ.js} +1 -1
- package/dist/ui/assets/{float-topology-DIH6ujZe.js → float-topology-COIC4j_U.js} +1 -1
- package/dist/ui/assets/{float-topology-C9GjBEv-.js → float-topology-C_iRKPQK.js} +1 -1
- package/dist/ui/assets/{follower-navigate-watcher-T4oXQ4JA.js → follower-navigate-watcher-C0CP4-Mn.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-DHfEFu3h.js → frozen-archive-writer-BAghzZbz.js} +1 -1
- package/dist/ui/assets/{fs-cmFfSwcb.js → fs-BUK-3Ws8.js} +2 -2
- package/dist/ui/assets/{fs-B7XQ_lrb.js → fs-CKSBDyCr.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-BQsQGJpu.js → gelatiere-unit-C4o5SngU.js} +1 -1
- package/dist/ui/assets/{github-Di3NkZKj.js → github-B4luVkMa.js} +2 -2
- package/dist/ui/assets/{github-a773Oj_3.js → github-BMfosoS8.js} +1 -1
- package/dist/ui/assets/{github-auth-ByvUzIEk.js → github-auth-CSG4xZUZ.js} +1 -1
- package/dist/ui/assets/{github-copilot-DhPt4wWn.js → github-copilot-BiPH9OJc.js} +1 -1
- package/dist/ui/assets/{github-copilot-BoeL-U7E.js → github-copilot-C6LhWXPC.js} +1 -1
- package/dist/ui/assets/{github-install-BNLZv80o.js → github-install-HX3c8n0G.js} +1 -1
- package/dist/ui/assets/{github-zip-CoNuW2sf.js → github-zip-CUIsX5nN.js} +1 -1
- package/dist/ui/assets/{go-driver-2ebSfg2I.js → go-driver-DTOA90JI.js} +1 -1
- package/dist/ui/assets/{guest-tool-gate-B3vJ2BGb.js → guest-tool-gate-CXdRgkkb.js} +1 -1
- package/dist/ui/assets/{hear-Cfl4YI74.js → hear-BU1G_yVs.js} +1 -1
- package/dist/ui/assets/{help-BMAczBRn.js → help-aKSKYJF6.js} +1 -1
- package/dist/ui/assets/host-command-CwRNpVLr.js +28 -0
- package/dist/ui/assets/image-processor-BlI3KRoz.js +1 -0
- package/dist/ui/assets/{installer-xdxoxN0e.js → installer-CbjJjnwg.js} +1 -1
- package/dist/ui/assets/{interrupted-work-recovery-6m6BONfO.js → interrupted-work-recovery-DSX617ic.js} +1 -1
- package/dist/ui/assets/{ipk-mamba-uom-JjRn.js → ipk-mamba-BRxsK-p_.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-CD271tMz.js → js-realm-worker-BYIiw840.js} +3 -3
- package/dist/ui/assets/{jsh-executor-DBwez91k.js → jsh-executor-f9UQQAJH.js} +2 -2
- package/dist/ui/assets/jsh-runtime-extensions-vA6JAYXY.js +1 -0
- package/dist/ui/assets/{kernel-worker-DOWZJuXM.js → kernel-worker-9lMint5X.js} +59 -59
- package/dist/ui/assets/{lick-ws-bridge-4IBz0Msz.js → lick-ws-bridge-Da6ciGE3.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-DQyoaYVX.js → lick-ws-bridge-HjQu1maH.js} +1 -1
- package/dist/ui/assets/{live-session-curation-ix1TPxM_.js → live-session-curation-CTwh1ml7.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-DnyhcCE6.js → live-session-snapshot-M1JFgsYL.js} +1 -1
- package/dist/ui/assets/live-vfs-fs-DgvdNXkS.js +1 -0
- package/dist/ui/assets/{local-llm-Q3t4kvLW.js → local-llm-B5MTvDcM.js} +1 -1
- package/dist/ui/assets/{local-llm-D5Ox2xst.js → local-llm-ByQE3h0R.js} +1 -1
- package/dist/ui/assets/main-Bu5EcQ93.js +22 -0
- package/dist/ui/assets/{main-cherry-e40IJV67.js → main-cherry-J5K4fq0A.js} +1 -1
- package/dist/ui/assets/{mcp-command-Bz_9ImDN.js → mcp-command-Cr-uabpd.js} +13 -13
- package/dist/ui/assets/{memory-curation-seam-80E0snGz.js → memory-curation-seam-D8IdKYZq.js} +1 -1
- package/dist/ui/assets/{memory-health-X7Z2HJgc.js → memory-health-CpYOFVO8.js} +1 -1
- package/dist/ui/assets/{memory-write-execute-CYpqPN9a.js → memory-write-execute-h9V1nD_3.js} +1 -1
- package/dist/ui/assets/{merge-folded-cost-into-frozen-DDVN7W9t.js → merge-folded-cost-into-frozen-DGSytgu9.js} +1 -1
- package/dist/ui/assets/{mount-CxIbhZc_.js → mount-BdStwj8s.js} +2 -3
- package/dist/ui/assets/{mount-Cdhbsamk.js → mount-DROut-7D.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-DEndUe7m.js → mount-bridge-client-DEvjkZ1N.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-DZrU_hNA.js → mount-bridge-client-DTSknauQ.js} +1 -1
- package/dist/ui/assets/new-session-BQRH4q6V.js +2 -0
- package/dist/ui/assets/oauth-bootstrap-BWTJ-MnR.js +2 -0
- package/dist/ui/assets/oauth-service-GpUOM3Aw.js +1 -0
- package/dist/ui/assets/oauth-service-MWzqRq2q.js +1 -0
- package/dist/ui/assets/{onboarding-orchestrator-BLrUNStK.js → onboarding-orchestrator-DJBNgmTb.js} +1 -1
- package/dist/ui/assets/{openai-codex-CePEMrS9.js → openai-codex-8SwwSHXG.js} +1 -1
- package/dist/ui/assets/{openai-codex-DEnFvLaq.js → openai-codex-CM1P6Cz7.js} +1 -1
- package/dist/ui/assets/{openrouter-C6Drz4Po.js → openrouter-C1-T42sa.js} +1 -1
- package/dist/ui/assets/{openrouter-CMbDityB.js → openrouter-CtJep7AD.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DPrVNMiX.js → openrouter-free-D5_NwI3F.js} +1 -1
- package/dist/ui/assets/{openrouter-free-jZRQi4fS.js → openrouter-free-Dn1SR1my.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DXfymZ6D.js → openrouter-oauth-BBFeemXH.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-BSKVr_20.js → openrouter-oauth-BP-y86gf.js} +1 -1
- package/dist/ui/assets/{opfs-mount-WSgDUNOX.js → opfs-mount-B745o1Vc.js} +1 -1
- package/dist/ui/assets/{page-approval-service-BbEv1dSc.js → page-approval-service-ja6kjLj8.js} +1 -1
- package/dist/ui/assets/panel-rpc-CR9k3qWE.js +1 -0
- package/dist/ui/assets/panel-rpc-accessor-B4BfPLSo.js +1 -0
- package/dist/ui/assets/panel-rpc-handlers-xhUd9DiV.js +2 -0
- package/dist/ui/assets/panel-rpc-sLZo8PD-.js +1 -0
- package/dist/ui/assets/{panelize-shell-C3g06QW7.js → panelize-shell-Bq22FVKD.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-DckrFCfi.js → pi-edit-execution-gtCS0kee.js} +1 -1
- package/dist/ui/assets/port-bridge-client-B-gpiOVR.js +1 -0
- package/dist/ui/assets/port-bridge-client-DAxhsvxm.js +1 -0
- package/dist/ui/assets/process-worker-v_IRtyyq.js +3 -0
- package/dist/ui/assets/{provider-BIKN9l0j.js → provider-DckNx7km.js} +2 -2
- package/dist/ui/assets/{provider-BDvld8wH.js → provider-ToQ_7wAn.js} +1 -1
- package/dist/ui/assets/{provider-settings-7gXmbpeE.js → provider-settings-D8mMRRmg.js} +1 -1
- package/dist/ui/assets/provider-store-access-CUeWZULe.js +1 -0
- package/dist/ui/assets/provider-store-access-DCRy_R8r.js +1 -0
- package/dist/ui/assets/providers-BAKMBUX7.js +2 -0
- package/dist/ui/assets/{providers-BSPfSjHX.js → providers-CvqwjkUB.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-Cplb-Tee.js → proxied-fetch-4VBgrEIu.js} +2 -2
- package/dist/ui/assets/{proxied-fetch-CoZ8jHud.js → proxied-fetch-F-dCBEfh.js} +1 -1
- package/dist/ui/assets/proxied-fetch-raw-DQ0-xn2O.js +2 -0
- package/dist/ui/assets/{proxied-fetch-raw-Cb_C44Cy.js → proxied-fetch-raw-DfWAMMUJ.js} +1 -1
- package/dist/ui/assets/{py-live-vfs-BY0JeFky.js → py-live-vfs-CPGqrKx-.js} +1 -1
- package/dist/ui/assets/{py-live-vfs-JNkDkEB1.js → py-live-vfs-CUwZTYN6.js} +1 -1
- package/dist/ui/assets/{py-realm-worker-DpNkD8fW.js → py-realm-worker-BoJbWJja.js} +1 -1
- package/dist/ui/assets/{quick-llm-B8_chMUu.js → quick-llm-DTjkRv5O.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-DGI1SPvf.js → realm-inprocess-BuDDW7XG.js} +3 -3
- package/dist/ui/assets/{realm-unhandled-rejections-CeQ49yI4.js → realm-unhandled-rejections-BFldJQ3o.js} +1 -1
- package/dist/ui/assets/{realm-unhandled-rejections-UooDX3DO.js → realm-unhandled-rejections-D9cNYqKO.js} +1 -1
- package/dist/ui/assets/{recovery-screen-DkW3-R4h.js → recovery-screen-DM7KfT4C.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-D5iSX82V.js → remote-terminal-view-BKdENaQD.js} +2 -2
- package/dist/ui/assets/{require-guards-BX-XDJnh.js → require-guards-DnafTLJr.js} +1 -1
- package/dist/ui/assets/{rest-ops-d6LSiWDZ.js → rest-ops-B7gv04VP.js} +1 -1
- package/dist/ui/assets/{rest-ops-DyAkn44S.js → rest-ops-j0P6ql7f.js} +1 -1
- package/dist/ui/assets/{restore-Cz3KzZZ7.js → restore-DkI2mzPD.js} +1 -1
- package/dist/ui/assets/{run-DKc_-F3f.js → run-2dqnHZde.js} +1 -1
- package/dist/ui/assets/{run-CB6rAQZ1.js → run-BAmXlRlW.js} +1 -1
- package/dist/ui/assets/{run-cvQKad0O.js → run-BRFnmkzR.js} +1 -1
- package/dist/ui/assets/{run-D6sdPJoQ.js → run-BYyvGPll.js} +4 -4
- package/dist/ui/assets/{run-Cl3auc8D.js → run-CUYkRfoU.js} +2 -2
- package/dist/ui/assets/{run-BvTkhul6.js → run-D6LxdCnL.js} +1 -1
- package/dist/ui/assets/{run-COcBu8_4.js → run-DH5HX1KA.js} +1 -1
- package/dist/ui/assets/run-DP50TUcp.js +18 -0
- package/dist/ui/assets/{run-DyYNRU6R.js → run-DPyr8Wk2.js} +1 -1
- package/dist/ui/assets/{run-ijndQJol.js → run-DZZd9Xb1.js} +3 -3
- package/dist/ui/assets/{run-B6qzuQBC.js → run-chEfqfQu.js} +1 -1
- package/dist/ui/assets/{screen-DVI9ujIL.js → screen-_l91vr17.js} +1 -1
- package/dist/ui/assets/{screencapture-run-DRiSGUJ9.js → screencapture-run-DXkhPPQJ.js} +1 -1
- package/dist/ui/assets/{script-catalog-CqkljCRS.js → script-catalog-WaCMvXY3.js} +1 -1
- package/dist/ui/assets/{secret-env-DQjPh_hw.js → secret-env-z9SReONx.js} +1 -1
- package/dist/ui/assets/secret-topology-hMRoGGjt.js +1 -0
- package/dist/ui/assets/{secrets-bridge-client-CWv2_nw7.js → secrets-bridge-client-D734Xx8G.js} +1 -1
- package/dist/ui/assets/{secrets-bridge-client-EgBSROu5.js → secrets-bridge-client-GOCzDscb.js} +1 -1
- package/dist/ui/assets/{session-command-memory-Dqd2Y1nf.js → session-command-memory-D4uJebvK.js} +2 -2
- package/dist/ui/assets/{session-jsonl-D0vuq6c1.js → session-jsonl-CYHALwzZ.js} +1 -1
- package/dist/ui/assets/{session-jsonl-BFDqAk2L.js → session-jsonl-DJeZaEAN.js} +1 -1
- package/dist/ui/assets/{session-search-index-CJRorVYP.js → session-search-index-C9BSuBgf.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-CWxbzwGB.js → setup-feature-flags-remote-B28utkza.js} +1 -1
- package/dist/ui/assets/{setup-model-catalog-CPpt1RYm.js → setup-model-catalog-D0KPq5D5.js} +1 -1
- package/dist/ui/assets/signed-fetch-DeDG40wV.js +1 -0
- package/dist/ui/assets/{silent-renew-backoff-D19EWo5j.js → silent-renew-backoff-CQhFgetu.js} +1 -1
- package/dist/ui/assets/slicc-version-CrbHwbo8.js +1 -0
- package/dist/ui/assets/snapshot-D6YGbggk.js +5 -0
- package/dist/ui/assets/{snapshot-features-HNBCRjfP.js → snapshot-features-Dw5v6SoZ.js} +1 -1
- package/dist/ui/assets/{soundscape-mtqG6Pmf.js → soundscape-CTffv_5Z.js} +1 -1
- package/dist/ui/assets/{speak-BOCxjk3p.js → speak-jCD0mSEW.js} +1 -1
- package/dist/ui/assets/sprinkle-manager-Y-YVEibf.js +1 -0
- package/dist/ui/assets/{sprinkle-renderer-DKK-prCv.js → sprinkle-renderer-CwX9FsqP.js} +1 -1
- package/dist/ui/assets/{ssh-_x-LG4bh.js → ssh-BWPgnSgg.js} +1 -1
- package/dist/ui/assets/state-Tykh4Vum.js +42 -0
- package/dist/ui/assets/{store-DL87lgMq.js → store-Mw1jky9b.js} +1 -1
- package/dist/ui/assets/{store-CVYChuZI.js → store-wiEGJ_43.js} +1 -1
- package/dist/ui/assets/stored-accounts-ChNHYF68.js +1 -0
- package/dist/ui/assets/stored-accounts-Cx83FZwe.js +1 -0
- package/dist/ui/assets/structured-output-tool-BrnZ-LJ8.js +1 -0
- package/dist/ui/assets/{sudo-C14r7p-e.js → sudo-C_rw_yTP.js} +3 -3
- package/dist/ui/assets/{sudo-fs-mI-V4QkM.js → sudo-fs-D88yRk1b.js} +1 -1
- package/dist/ui/assets/sudo-refusal-DVwTXFRE.js +1 -0
- package/dist/ui/assets/{supervisor-CRki_wn9.js → supervisor-DpgpPBmC.js} +1 -1
- package/dist/ui/assets/{sync-dialog-BMLUDjd4.js → sync-dialog-CupzPdES.js} +1 -1
- package/dist/ui/assets/{transformers-env-C0z5rcqN.js → transformers-env-YtNL0QDY.js} +1 -1
- package/dist/ui/assets/{tray-leader-BdvK7KWc.js → tray-leader-DXDclF_5.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-Chumo3x-.js → tray-leave-runtime-VOHZS65W.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-ConrTcOf.js → tray-runtime-config-CBx5P3dS.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-gXArrwO5.js → tray-sidecar-96t7GtIU.js} +1 -1
- package/dist/ui/assets/{turn-journal-Fz2l3QO4.js → turn-journal-EgGBqAjY.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-Bl00km0Z.js → upgrade-detection-A_vnZ-VL.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-DTxpkXaG.js → upskill-lick-skip-u8HuNUy0.js} +1 -1
- package/dist/ui/assets/{voice-reply-LXLV67Nm.js → voice-reply-BlnWgLQN.js} +1 -1
- package/dist/ui/assets/{wasi-runtime-Bc01Bdaa.js → wasi-runtime-Wx_rcXbK.js} +2 -2
- package/dist/ui/assets/{wasm-programs-DPZtEzCA.js → wasm-programs-Bd5YaoqY.js} +1 -1
- package/dist/ui/assets/wc-attach-BD99mw1C.js +13 -0
- package/dist/ui/assets/{wc-browser-C3BrDOs9.js → wc-browser-ibm_kzUA.js} +1 -1
- package/dist/ui/assets/{wc-computers-5ZseiRnv.js → wc-computers-KrtriEYD.js} +1 -1
- package/dist/ui/assets/{wc-detached-DK9sSKZr.js → wc-detached-DW6GEnzV.js} +1 -1
- package/dist/ui/assets/wc-extension-dbdfxaHn.js +2 -0
- package/dist/ui/assets/wc-follower-CY0Omxnm.js +17 -0
- package/dist/ui/assets/{wc-follower-oauth-g_NJ62P_.js → wc-follower-oauth-obhVV1ID.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-C_kV3iUh.js → wc-gelatiere-BlK8fV98.js} +1 -1
- package/dist/ui/assets/{wc-live-CN_PjeIo.js → wc-live-WP25Nrx4.js} +6 -6
- package/dist/ui/assets/wc-nav-BA8Cj8Lu.js +2 -0
- package/dist/ui/assets/{wc-onboarding-BJrwUBcv.js → wc-onboarding-g_I2jf5C.js} +2 -2
- package/dist/ui/assets/{wc-permissions-D-mQCivR.js → wc-permissions-C_Q050u-.js} +2 -2
- package/dist/ui/assets/wc-placeholder-DaIZj3ba.js +4 -0
- package/dist/ui/assets/{wc-secret-request-BJXcNpDs.js → wc-secret-request-lw7JW61R.js} +1 -1
- package/dist/ui/assets/{wc-settings-DOYvmcRg.js → wc-settings-g5B5-OSw.js} +3 -3
- package/dist/ui/assets/{wc-shell-B6woD-e6.js → wc-shell-DrGgyuS_.js} +5 -5
- package/dist/ui/assets/{wc-shortcut-config-BUM7oKUu.js → wc-shortcut-config-C3GIv71k.js} +1 -1
- package/dist/ui/assets/wc-sprinkles-Dh8yXR2X.js +2 -0
- package/dist/ui/assets/{wc-transcript-export-RedJl591.js → wc-transcript-export-Dw-bOyW2.js} +2 -2
- package/dist/ui/assets/{wc-tray-BxsYHBdR.js → wc-tray-DJNwevYd.js} +4 -4
- package/dist/ui/assets/welcome-detection-CU3MtuFw.js +1 -0
- package/dist/ui/assets/whisper-session-Bkc60xQi.js +2 -0
- package/dist/ui/assets/{xai-grok-CAnhMyf-.js → xai-grok-BvqSa-5b.js} +1 -1
- package/dist/ui/assets/{xai-grok-Ch54hmZJ.js → xai-grok-DFQUduEg.js} +1 -1
- package/dist/ui/index.html +11 -10
- package/dist/ui/packages/webapp/index.html +11 -10
- package/package.json +1 -1
- package/dist/ui/assets/SKILL-B4YYagrM.js +0 -1
- package/dist/ui/assets/account-store-CfWRzPpT.js +0 -2
- package/dist/ui/assets/account-store-bUzcsJR2.js +0 -1
- package/dist/ui/assets/adobe-CugR6QpI.js +0 -2
- package/dist/ui/assets/adobe-ytXYifQq.js +0 -1
- package/dist/ui/assets/approval-timeout-CeQbGMnv.js +0 -1
- package/dist/ui/assets/core-ButDwsf2.js +0 -36
- package/dist/ui/assets/emscripten-vfs-hook-c6XYWLDN.js +0 -1
- package/dist/ui/assets/host-command-Dn-Z4AbC.js +0 -28
- package/dist/ui/assets/jsh-runtime-extensions-DiQ9SvKe.js +0 -1
- package/dist/ui/assets/live-vfs-fs-Y4sN9OvN.js +0 -1
- package/dist/ui/assets/main-D9hbfd93.js +0 -22
- package/dist/ui/assets/new-session-CKsA3Osa.js +0 -2
- package/dist/ui/assets/oauth-bootstrap-B7RkQZg-.js +0 -2
- package/dist/ui/assets/oauth-service-B-vKfxAF.js +0 -1
- package/dist/ui/assets/oauth-service-Bx_Dy3GC.js +0 -1
- package/dist/ui/assets/panel-rpc-D3EPRnmw.js +0 -1
- package/dist/ui/assets/panel-rpc-DW7W4w6_.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-D8o2EggL.js +0 -2
- package/dist/ui/assets/port-bridge-client-BmVU5J9w.js +0 -1
- package/dist/ui/assets/port-bridge-client-D_erEovW.js +0 -2
- package/dist/ui/assets/process-worker-BKgTk6Wd.js +0 -3
- package/dist/ui/assets/provider-store-access-B3yjrPLi.js +0 -1
- package/dist/ui/assets/provider-store-access-Bq7yMlLd.js +0 -1
- package/dist/ui/assets/providers-Qqp-ZEtv.js +0 -2
- package/dist/ui/assets/proxied-fetch-raw-Di1Dm8fV.js +0 -2
- package/dist/ui/assets/run-Cu1hr00X.js +0 -18
- package/dist/ui/assets/secret-topology-Dm_PZRZx.js +0 -1
- package/dist/ui/assets/signed-fetch-AA2u7LJq.js +0 -1
- package/dist/ui/assets/slicc-version-BjIQb9Hz.js +0 -1
- package/dist/ui/assets/snapshot-DLO8RkOr.js +0 -5
- package/dist/ui/assets/sprinkle-manager-UKlMkzSm.js +0 -1
- package/dist/ui/assets/state-B892uW3H.js +0 -42
- package/dist/ui/assets/structured-output-tool-BDaIhclx.js +0 -1
- package/dist/ui/assets/wc-attach-ChUPT4oB.js +0 -13
- package/dist/ui/assets/wc-extension-BC5R5cd7.js +0 -2
- package/dist/ui/assets/wc-follower-Dn9JVmb_.js +0 -17
- package/dist/ui/assets/wc-nav-DqpOaNr_.js +0 -2
- package/dist/ui/assets/wc-placeholder-D2NGiBVr.js +0 -4
- package/dist/ui/assets/wc-sprinkles-Q2JU6sSY.js +0 -2
- package/dist/ui/assets/welcome-detection-CrnFBTZe.js +0 -1
- package/dist/ui/assets/whisper-session-BaYhywEf.js +0 -2
package/dist/ui/assets/{memory-write-execute-CYpqPN9a.js → memory-write-execute-h9V1nD_3.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./path-utils-DNJG-zQf.js";import{a as t,o as n}from"./memory-budget-CFfevxz_.js";import{n as r,t as i}from"./kernel-worker-
|
|
1
|
+
import{n as e}from"./path-utils-DNJG-zQf.js";import{a as t,o as n}from"./memory-budget-CFfevxz_.js";import{n as r,t as i}from"./kernel-worker-9lMint5X.js";function a(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.oldText==`string`&&typeof e.newText==`string`)}function o(e,t){let n=e;for(let[e,r]of t.entries()){if(r.oldText.length===0)return{ok:!1,error:`edit ${e+1}: oldText must not be empty`};let t=n.indexOf(r.oldText);if(t===-1)return{ok:!1,error:`edit ${e+1}: oldText not found in the current file`};if(n.indexOf(r.oldText,t+1)!==-1)return{ok:!1,error:`edit ${e+1}: oldText occurs more than once; include more context to make it unique`};n=n.slice(0,t)+r.newText+n.slice(t+r.oldText.length)}return{ok:!0,content:n}}function s(e,t){return e<=t?`${e} chars, ${t-e} under the ${t}-char budget.`:`${e} chars, ${e-t} OVER the ${t}-char budget — the next write must be smaller than ${e} chars.`}function c(e,t,n){if(t<=n||t<e)return{allowed:!0};let r=t-n;return{allowed:!1,reason:`Rejected: the file would ${t===e?`stay at ${e} chars`:`grow from ${e} to ${t} chars`}, ${r} over the ${n}-char budget. Over budget, a write must shrink the file — cut a whole section rather than shaving characters, then write again.`}}function l(e,t){return`Rejected: this line records ${e} as absent or refuted, but ${e} is outside this pass's visiblePaths — every read of it answered "not visible", which means UNKNOWN, never absent. Keep the stored claim as it was, or name the unverifiable pair in your closing report instead. Line: ${t}`}async function u(e,t){try{let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}catch(e){if(e?.code===`ENOENT`)return null;throw e}}function d(e,t,n){if(typeof e.content==`string`)return{ok:!0,next:e.content};if(!a(e.edits))return{ok:!1,error:"`edits` must be a list of { oldText, newText }"};if(t===null)return{ok:!1,error:`${n} does not exist yet — pass \`content\` to create it`};let r=o(t,e.edits);return r.ok?{ok:!0,next:r.content}:r}async function f(a,o,f){if(typeof f.path!=`string`||f.path.length===0)return{content:"memory_write: `path` is required",isError:!0};let p=e(f.path);if(!n(p))return{content:`memory_write: ${p} is not a memory file — use write_file or edit for ordinary files`,isError:!0};if(typeof f.content==`string`==(f.edits!==void 0))return{content:"memory_write: pass exactly one of `content` (whole file) or `edits` (exact replacements)",isError:!0};try{let e=await u(a,p),n=d(f,e,p);if(!n.ok)return{content:`memory_write: ${n.error}`,isError:!0};let m=t(await o.readSessionCount()),h=c(e?.length??0,n.next.length,m);if(!h.allowed)return{content:`memory_write: ${h.reason}`,isError:!0};let g=r(e??``,n.next,o.blindPaths?.()??[]);if(g)return{content:`memory_write: ${l(g.path,g.line)}`,isError:!0};await a.writeFile(p,n.next);let _=await i(a,p,n.next);return _?{content:_,isError:!0}:{content:`Wrote ${p}: ${s(n.next.length,m)}`}}catch(e){return{content:e instanceof Error?e.message:String(e),isError:!0}}}export{f as executeMemoryWrite};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./record-COQlaFL1.js";import{s as e}from"./kernel-worker-
|
|
1
|
+
import"./record-COQlaFL1.js";import{s as e}from"./kernel-worker-9lMint5X.js";import{u as t}from"./frozen-archive-writer-BAghzZbz.js";async function n(n,a,o){if(o.length===0)return!1;let s=a.folder||`cone`,c=(await e(n)).filter(e=>(e.cone??`cone`)===s);if(c.length===0)return!1;let l=c.reduce((e,t)=>t.frozenAt>e.frozenAt?t:e),u={...l,cost:r(l.cost,o),models:i(l.models,o)};return await t(n,u),!0}function r(e,t){let n=e?.total??0,r=e?.input??0,i=e?.output??0,a=e?.cacheRead??0,o=e?.cacheWrite??0;for(let e of t)n+=e.usage.cost.total,r+=e.usage.cost.input,i+=e.usage.cost.output,a+=e.usage.cost.cacheRead,o+=e.usage.cost.cacheWrite;return{total:n,input:r,output:i,cacheRead:a,cacheWrite:o}}function i(e,t){let n=new Map;for(let t of e??[])n.set(t.model,{...t});for(let e of t){let t=n.get(e.model)??{model:e.model,cost:0,turns:0,tokens:0};t.cost+=e.usage.cost.total,t.turns+=1,t.tokens+=e.usage.totalTokens,n.set(e.model,t)}return[...n.values()].sort((e,t)=>t.cost-e.cost)}export{n as mergeFoldedCostIntoLatestFrozen};
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import{t as e}from"./preload-helper-Czpn1I53.js";import{n as t}from"./mime-types-D0xZwlMO.js";import{r as n,t as r}from"./base64-ELzoYfwP.js";import{t as i}from"./types-D8gIX-W-.js";import"./mount-table-store-dY2IfQ5S.js";import"./fs-cmFfSwcb.js";import{t as a}from"./remote-cache-CuIV6-dC.js";var o=`https://api.aem.live`,s=`application/folder`,c=5242880;function l(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 u(e){if(!e)return``;let t=Date.parse(e);return Number.isNaN(t)?``:String(t)}function d(e){let t=Date.parse(e??``);return Number.isNaN(t)?0:t}function f(e){return e.map(e=>e[`content-type`]===s||e.name.endsWith(`/`)?{name:e.name.replace(/\/+$/,``),kind:`directory`}:{name:e.name,kind:`file`,size:e.size,etag:u(e[`last-modified`]),lastModified:d(e[`last-modified`])})}var p=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=l(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??c,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new i(`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:o,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 i(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new i(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new i(`EIO`,`aem readFile failed: ${r.status}`,e);let a=new Uint8Array(await r.arrayBuffer());if(a.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);return await this.cache.putBody(t,a,u(r.headers.get(`last-modified`))),a}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 i(`EIO`,`aem precondition HEAD failed: ${r.status}`,e);let a=u(r.headers.get(`last-modified`));if(a&&a!==n)throw await this.cache.invalidateBody(t),new i(`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 i(`EFBIG`,`body exceeds maxBodyBytes`,e);let n=this.toMountRelative(e),r=await this.cache.getBody(n);await this.assertUnchanged(e,n,r?.etag??``);let a=await this.request(`PUT`,this.toSourcePath(n),{body:t});if(a.status===401||a.status===403)throw new i(`EACCES`,`aem write denied`,e);if(a.status>=400)throw new i(`EIO`,`aem writeFile failed: ${a.status}`,e);await this.cache.invalidateBody(n);let o=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(o)}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 i(`ENOENT`,`no such directory`,e);if(r.status===401||r.status===403)throw new i(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new i(`EIO`,`aem list failed: ${r.status}`,e);let a=f(await r.json());return await this.cache.putListing(t,a),a}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(`/`),a=r.pop()??``,o=r.join(`/`),s=await this.cache.getListing(o),c=(s&&!this.cache.isStale(s.cachedAt)?s.entries:await this.readDirQuietly(o))?.find(e=>e.name===a);if(!c)throw new i(`ENOENT`,`no such file or directory`,e);return c.kind===`directory`?{kind:`directory`,size:0,mtime:c.lastModified??0}:{kind:`file`,size:c.size??0,mtime:c.lastModified??0,etag:c.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 i(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new i(`EACCES`,`aem delete denied`,e);if(n.status>=400)throw new i(`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=f(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}},m=`\r
|
|
3
|
-
`;function h(){let e=new Uint8Array(16);if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`)crypto.getRandomValues(e);else for(let t=0;t<e.length;t+=1)e[t]=Math.floor(Math.random()*256);let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return`----SliccFormBoundary${t}`}function g(e,t=h()){let n=new TextEncoder,r=[];for(let i of e){let e=v(_(i.name));if(`file`in i){let a=v(i.file.filename),o=y(i.file.contentType)||`application/octet-stream`;r.push(n.encode(`--${t}${m}Content-Disposition: form-data; name="${e}"; filename="${a}"${m}Content-Type: ${o}${m}${m}`)),r.push(i.file.bytes),r.push(n.encode(m))}else r.push(n.encode(`--${t}${m}Content-Disposition: form-data; name="${e}"${m}${m}${_(i.value)}${m}`))}return r.push(n.encode(`--${t}--${m}`)),{bytes:b(r),contentType:`multipart/form-data; boundary=${t}`,boundary:t}}function _(e){return e.replace(/\r\n|\r|\n/g,m)}function v(e){return e.replace(/\r/g,`%0D`).replace(/\n/g,`%0A`).replace(/"/g,`%22`)}function y(e){return(e??``).replace(/[\r\n]/g,``).trim()}function b(e){let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}function x(e,t,n){let r=g([{name:`data`,file:{bytes:n,filename:e,contentType:t}}]);return{contentType:r.contentType,body:r.bytes}}function S(e){return e.split(`/`).pop()||`data`}function C(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 w=5242880,T=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=C(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??w,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new i(`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 a=await this.transport({method:`GET`,path:this.toSourcePath(t),headers:r});if(a.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(a.status===404)throw await this.cache.invalidateBody(t),new i(`ENOENT`,`no such file`,e);if(a.status===401||a.status===403)throw new i(`EACCES`,`da access denied`,e);if(a.status>=400)throw new i(`EIO`,`da readFile failed: ${a.status}`,e);let o=a.headers.get(`content-length`),s=o?Number(o):void 0;if(s!==void 0&&s>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let c=new Uint8Array(await a.arrayBuffer());if(c.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let l=a.headers.get(`etag`)??``,u=l.startsWith(`W/`)?l.slice(2):l;return await this.cache.putBody(t,c,u),c}async writeFile(e,n){if(this.assertOpen(e),n.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let r=this.toMountRelative(e),a=await this.cache.getBody(r),o=x(S(e),t(e),n),s={"content-type":o.contentType,"content-length":String(o.body.byteLength)};a?.etag?s[`if-match`]=a.etag.startsWith(`W/`)?a.etag.slice(2):a.etag:a||(s[`if-none-match`]=`*`);let c=()=>this.transport({method:`POST`,path:this.toSourcePath(r),headers:s,body:o.body}),l,u=1;try{l=await c()}catch{u=2,l=await c()}if(l.status===412){if(u===2){let t=await this.transport({method:`HEAD`,path:this.toSourcePath(r)});if(t.status>=400)throw new i(`EIO`,`da reconcile HEAD failed: ${t.status}`,e);let a=t.headers.get(`etag`)??``;await this.cache.putBody(r,n,a);let o=r.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(o);return}await this.cache.invalidateBody(r);try{await this.readFile(e)}catch{}throw new i(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(l.status===401||l.status===403)throw new i(`EACCES`,`da write denied`,e);if(l.status>=400)throw new i(`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 i(`ENOENT`,`no such directory`,e);if(r.status>=400)throw new i(`EIO`,`da list failed: ${r.status}`,e);let a=(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,a),a}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(`/`),a=r.pop()??``,o=r.join(`/`),s=await this.cache.getListing(o);if(s&&!this.cache.isStale(s.cachedAt)){let t=s.entries.find(e=>e.name===a);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??s.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??s.cachedAt};if(!t)throw new i(`ENOENT`,`no such file or directory`,e)}let c=await this.transport({method:`HEAD`,path:this.toSourcePath(t)});if(c.status===200){let e=Number(c.headers.get(`content-length`)??`0`),t=c.headers.get(`etag`)??``,n=c.headers.get(`last-modified`),r=n?Date.parse(n):0;if(s){let n=s.entries.map(n=>n.name===a&&n.kind===`file`?{...n,size:e,etag:t,lastModified:r}:n);await this.cache.putListing(o,n)}return{kind:`file`,size:e,mtime:r,etag:t}}if(c.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new i(`ENOENT`,`no such file or directory`,e)}throw new i(`EIO`,`da stat failed: ${c.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 i(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new i(`EACCES`,`da delete denied`,e);if(n.status>=400)throw new i(`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 E(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 D=26214400,O=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=E(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??D,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new i(`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 a=await this.transport({method:`GET`,bucket:this.parsed.bucket,key:this.toS3Key(t),headers:r});if(a.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(a.status===404)throw await this.cache.invalidateBody(t),new i(`ENOENT`,`no such file`,e);if(a.status===401||a.status===403)throw new i(`EACCES`,`s3 access denied`,e);if(a.status>=400)throw new i(`EIO`,`s3 readFile failed: ${a.status}`,e);let o=a.headers.get(`content-length`),s=o?Number(o):void 0;if(s!==void 0&&s>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes (${s} > ${this.maxBodyBytes})`,e);let c=new Uint8Array(await a.arrayBuffer());if(c.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let l=a.headers.get(`etag`)??``;return await this.cache.putBody(t,c,l),c}async writeFile(e,t){this.assertOpen(e);let n=this.toMountRelative(e);if(t.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let r=await this.cache.getBody(n),a={"content-type":`application/octet-stream`,"content-length":String(t.byteLength)};r?a[`if-match`]=r.etag:a[`if-none-match`]=`*`;let o=()=>this.transport({method:`PUT`,bucket:this.parsed.bucket,key:this.toS3Key(n),headers:a,body:t}),s,c=1;try{s=await o()}catch{c=2,s=await o()}if(s.status===412){if(c===2){let r=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(n)});if(r.status>=400)throw new i(`EIO`,`s3 reconcile HEAD failed: ${r.status}`,e);let a=r.headers.get(`etag`)??``;await this.cache.putBody(n,t,a);let o=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(o);return}await this.cache.invalidateBody(n);try{await this.readFile(e)}catch{}throw new i(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(s.status===401||s.status===403)throw new i(`EACCES`,`s3 write denied`,e);if(s.status>=400)throw new i(`EIO`,`s3 writeFile failed: ${s.status}`,e);let l=s.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 i(`EIO`,`s3 list failed: ${r.status}`,`/`);let a=await r.text(),o=this.parseListingXml(a);e.push(...o.contents),t=o.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(`/`),a=r.pop()??``,o=r.join(`/`),s=await this.cache.getListing(o);if(s&&!this.cache.isStale(s.cachedAt)){let t=s.entries.find(e=>e.name===a);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??s.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??s.cachedAt};if(!t)throw new i(`ENOENT`,`no such file or directory`,e)}let c=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(t)});if(c.status===200){let e=Number(c.headers.get(`content-length`)??`0`),t=c.headers.get(`etag`)??``,n=c.headers.get(`last-modified`);return{kind:`file`,size:e,mtime:n?Date.parse(n):0,etag:t}}if(c.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new i(`ENOENT`,`no such file or directory`,e)}throw new i(`EIO`,`s3 stat failed: ${c.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 i(`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 i(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new i(`EACCES`,`s3 delete denied`,e);if(r.status>=400)throw new i(`EIO`,`s3 delete failed: ${r.status}`,e);await this.cache.invalidateBody(n);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a)}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}},k=class extends Error{constructor(e){super(e),this.name=`ProfileNotConfiguredError`}};async function A(){let{getAccounts:t}=await e(async()=>{let{getAccounts:e}=await import(`./account-store-CfWRzPpT.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,27,28,29])),n=t().find(e=>e.providerId===`adobe`);if(!n?.accessToken)throw new k(`No Adobe IMS account found. Log in via Settings → Providers → Adobe first.`);return{identity:`adobe-ims`,getBearerToken:async()=>n.accessToken}}var j=r,M=n,N=new Set([`invalid_profile`,`invalid_request`,`profile_not_configured`,`fetch_failed`,`internal`]),P=new Set([101,103,204,205,304]);function F(e){if(!e.ok)throw e.errorCode===`profile_not_configured`||e.errorCode===`invalid_profile`?new i(`EACCES`,e.error):e.errorCode===`invalid_request`?new i(`EINVAL`,e.error):e.errorCode===`fetch_failed`||e.errorCode===`internal`||N.has(String(e.errorCode))?new i(`EIO`,e.error):new i(`EINVAL`,`mount transport returned unrecognized errorCode '${e.errorCode}': ${e.error}`);let t;try{t=j(e.bodyBase64)}catch(e){throw new i(`EIO`,`mount transport: response body decode failed: ${e instanceof Error?e.message:String(e)}`)}let n=P.has(e.status)?null:t;return new Response(n,{status:e.status,headers:new Headers(e.headers)})}async function I(e){throw new i(`EIO`,`mount transport unavailable: setMountCapabilityBroker was never called for this float (composition bug — refusing to guess a transport for a privileged sign-and-forward request)`)}function L(e){return async t=>F(await I({backend:`s3`,envelope:{profile:e,method:t.method,bucket:t.bucket,key:t.key,query:t.query,headers:t.headers,bodyBase64:t.body?M(t.body):void 0}}))}function R(e){let t=e?.getImsToken??(async()=>(await A()).getBearerToken());return async e=>{let n;try{n=await t()}catch(e){throw new i(`EACCES`,`DA mount: ${e instanceof Error?e.message:String(e)}`)}return F(await I({backend:`da`,envelope:{imsToken:n,method:e.method,path:e.path,origin:e.origin,query:e.query,headers:e.headers,bodyBase64:e.body?M(e.body):void 0}}))}}export{p as AemMountBackend,T as DaMountBackend,a as RemoteMountCache,O as S3MountBackend,R as makeSignedFetchDa,L as makeSignedFetchS3};
|
|
1
|
+
import{n as e}from"./mime-types-D0xZwlMO.js";import{r as t,t as n}from"./base64-ELzoYfwP.js";import{n as r}from"./stored-accounts-ChNHYF68.js";import{t as i}from"./types-D8gIX-W-.js";import"./mount-table-store-dY2IfQ5S.js";import"./fs-BUK-3Ws8.js";import{t as a}from"./remote-cache-CuIV6-dC.js";var o=`https://api.aem.live`,s=`application/folder`,c=5242880;function l(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 u(e){if(!e)return``;let t=Date.parse(e);return Number.isNaN(t)?``:String(t)}function d(e){let t=Date.parse(e??``);return Number.isNaN(t)?0:t}function f(e){return e.map(e=>e[`content-type`]===s||e.name.endsWith(`/`)?{name:e.name.replace(/\/+$/,``),kind:`directory`}:{name:e.name,kind:`file`,size:e.size,etag:u(e[`last-modified`]),lastModified:d(e[`last-modified`])})}var p=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=l(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??c,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new i(`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:o,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 i(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new i(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new i(`EIO`,`aem readFile failed: ${r.status}`,e);let a=new Uint8Array(await r.arrayBuffer());if(a.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);return await this.cache.putBody(t,a,u(r.headers.get(`last-modified`))),a}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 i(`EIO`,`aem precondition HEAD failed: ${r.status}`,e);let a=u(r.headers.get(`last-modified`));if(a&&a!==n)throw await this.cache.invalidateBody(t),new i(`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 i(`EFBIG`,`body exceeds maxBodyBytes`,e);let n=this.toMountRelative(e),r=await this.cache.getBody(n);await this.assertUnchanged(e,n,r?.etag??``);let a=await this.request(`PUT`,this.toSourcePath(n),{body:t});if(a.status===401||a.status===403)throw new i(`EACCES`,`aem write denied`,e);if(a.status>=400)throw new i(`EIO`,`aem writeFile failed: ${a.status}`,e);await this.cache.invalidateBody(n);let o=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(o)}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 i(`ENOENT`,`no such directory`,e);if(r.status===401||r.status===403)throw new i(`EACCES`,`aem access denied`,e);if(r.status>=400)throw new i(`EIO`,`aem list failed: ${r.status}`,e);let a=f(await r.json());return await this.cache.putListing(t,a),a}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(`/`),a=r.pop()??``,o=r.join(`/`),s=await this.cache.getListing(o),c=(s&&!this.cache.isStale(s.cachedAt)?s.entries:await this.readDirQuietly(o))?.find(e=>e.name===a);if(!c)throw new i(`ENOENT`,`no such file or directory`,e);return c.kind===`directory`?{kind:`directory`,size:0,mtime:c.lastModified??0}:{kind:`file`,size:c.size??0,mtime:c.lastModified??0,etag:c.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 i(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new i(`EACCES`,`aem delete denied`,e);if(n.status>=400)throw new i(`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=f(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}},m=`\r
|
|
2
|
+
`;function h(){let e=new Uint8Array(16);if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`)crypto.getRandomValues(e);else for(let t=0;t<e.length;t+=1)e[t]=Math.floor(Math.random()*256);let t=``;for(let n of e)t+=n.toString(16).padStart(2,`0`);return`----SliccFormBoundary${t}`}function g(e,t=h()){let n=new TextEncoder,r=[];for(let i of e){let e=v(_(i.name));if(`file`in i){let a=v(i.file.filename),o=y(i.file.contentType)||`application/octet-stream`;r.push(n.encode(`--${t}${m}Content-Disposition: form-data; name="${e}"; filename="${a}"${m}Content-Type: ${o}${m}${m}`)),r.push(i.file.bytes),r.push(n.encode(m))}else r.push(n.encode(`--${t}${m}Content-Disposition: form-data; name="${e}"${m}${m}${_(i.value)}${m}`))}return r.push(n.encode(`--${t}--${m}`)),{bytes:b(r),contentType:`multipart/form-data; boundary=${t}`,boundary:t}}function _(e){return e.replace(/\r\n|\r|\n/g,m)}function v(e){return e.replace(/\r/g,`%0D`).replace(/\n/g,`%0A`).replace(/"/g,`%22`)}function y(e){return(e??``).replace(/[\r\n]/g,``).trim()}function b(e){let t=0;for(let n of e)t+=n.byteLength;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}function x(e,t,n){let r=g([{name:`data`,file:{bytes:n,filename:e,contentType:t}}]);return{contentType:r.contentType,body:r.bytes}}function S(e){return e.split(`/`).pop()||`data`}function C(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 w=5242880,T=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=C(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??w,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new i(`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 a=await this.transport({method:`GET`,path:this.toSourcePath(t),headers:r});if(a.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(a.status===404)throw await this.cache.invalidateBody(t),new i(`ENOENT`,`no such file`,e);if(a.status===401||a.status===403)throw new i(`EACCES`,`da access denied`,e);if(a.status>=400)throw new i(`EIO`,`da readFile failed: ${a.status}`,e);let o=a.headers.get(`content-length`),s=o?Number(o):void 0;if(s!==void 0&&s>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let c=new Uint8Array(await a.arrayBuffer());if(c.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let l=a.headers.get(`etag`)??``,u=l.startsWith(`W/`)?l.slice(2):l;return await this.cache.putBody(t,c,u),c}async writeFile(t,n){if(this.assertOpen(t),n.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,t);let r=this.toMountRelative(t),a=await this.cache.getBody(r),o=x(S(t),e(t),n),s={"content-type":o.contentType,"content-length":String(o.body.byteLength)};a?.etag?s[`if-match`]=a.etag.startsWith(`W/`)?a.etag.slice(2):a.etag:a||(s[`if-none-match`]=`*`);let c=()=>this.transport({method:`POST`,path:this.toSourcePath(r),headers:s,body:o.body}),l,u=1;try{l=await c()}catch{u=2,l=await c()}if(l.status===412){if(u===2){let e=await this.transport({method:`HEAD`,path:this.toSourcePath(r)});if(e.status>=400)throw new i(`EIO`,`da reconcile HEAD failed: ${e.status}`,t);let a=e.headers.get(`etag`)??``;await this.cache.putBody(r,n,a);let o=r.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(o);return}await this.cache.invalidateBody(r);try{await this.readFile(t)}catch{}throw new i(`EBUSY`,`remote modified since last read — re-read and retry`,t)}if(l.status===401||l.status===403)throw new i(`EACCES`,`da write denied`,t);if(l.status>=400)throw new i(`EIO`,`da writeFile failed: ${l.status}`,t);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 i(`ENOENT`,`no such directory`,e);if(r.status>=400)throw new i(`EIO`,`da list failed: ${r.status}`,e);let a=(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,a),a}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(`/`),a=r.pop()??``,o=r.join(`/`),s=await this.cache.getListing(o);if(s&&!this.cache.isStale(s.cachedAt)){let t=s.entries.find(e=>e.name===a);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??s.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??s.cachedAt};if(!t)throw new i(`ENOENT`,`no such file or directory`,e)}let c=await this.transport({method:`HEAD`,path:this.toSourcePath(t)});if(c.status===200){let e=Number(c.headers.get(`content-length`)??`0`),t=c.headers.get(`etag`)??``,n=c.headers.get(`last-modified`),r=n?Date.parse(n):0;if(s){let n=s.entries.map(n=>n.name===a&&n.kind===`file`?{...n,size:e,etag:t,lastModified:r}:n);await this.cache.putListing(o,n)}return{kind:`file`,size:e,mtime:r,etag:t}}if(c.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new i(`ENOENT`,`no such file or directory`,e)}throw new i(`EIO`,`da stat failed: ${c.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 i(`ENOENT`,`no such file`,e);if(n.status===401||n.status===403)throw new i(`EACCES`,`da delete denied`,e);if(n.status>=400)throw new i(`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 E(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 D=26214400,O=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=E(e.source),this.cache=e.cache,this.maxBodyBytes=e.maxBodyBytes??D,this.transport=e.signedFetch}assertOpen(e){if(this.closed)throw new i(`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 a=await this.transport({method:`GET`,bucket:this.parsed.bucket,key:this.toS3Key(t),headers:r});if(a.status===304&&n)return await this.cache.putBody(t,n.body,n.etag),n.body;if(a.status===404)throw await this.cache.invalidateBody(t),new i(`ENOENT`,`no such file`,e);if(a.status===401||a.status===403)throw new i(`EACCES`,`s3 access denied`,e);if(a.status>=400)throw new i(`EIO`,`s3 readFile failed: ${a.status}`,e);let o=a.headers.get(`content-length`),s=o?Number(o):void 0;if(s!==void 0&&s>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes (${s} > ${this.maxBodyBytes})`,e);let c=new Uint8Array(await a.arrayBuffer());if(c.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let l=a.headers.get(`etag`)??``;return await this.cache.putBody(t,c,l),c}async writeFile(e,t){this.assertOpen(e);let n=this.toMountRelative(e);if(t.byteLength>this.maxBodyBytes)throw new i(`EFBIG`,`body exceeds maxBodyBytes`,e);let r=await this.cache.getBody(n),a={"content-type":`application/octet-stream`,"content-length":String(t.byteLength)};r?a[`if-match`]=r.etag:a[`if-none-match`]=`*`;let o=()=>this.transport({method:`PUT`,bucket:this.parsed.bucket,key:this.toS3Key(n),headers:a,body:t}),s,c=1;try{s=await o()}catch{c=2,s=await o()}if(s.status===412){if(c===2){let r=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(n)});if(r.status>=400)throw new i(`EIO`,`s3 reconcile HEAD failed: ${r.status}`,e);let a=r.headers.get(`etag`)??``;await this.cache.putBody(n,t,a);let o=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(o);return}await this.cache.invalidateBody(n);try{await this.readFile(e)}catch{}throw new i(`EBUSY`,`remote modified since last read — re-read and retry`,e)}if(s.status===401||s.status===403)throw new i(`EACCES`,`s3 write denied`,e);if(s.status>=400)throw new i(`EIO`,`s3 writeFile failed: ${s.status}`,e);let l=s.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 i(`EIO`,`s3 list failed: ${r.status}`,`/`);let a=await r.text(),o=this.parseListingXml(a);e.push(...o.contents),t=o.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(`/`),a=r.pop()??``,o=r.join(`/`),s=await this.cache.getListing(o);if(s&&!this.cache.isStale(s.cachedAt)){let t=s.entries.find(e=>e.name===a);if(t?.kind===`file`&&t.size!==void 0)return{kind:`file`,size:t.size,mtime:t.lastModified??s.cachedAt,etag:t.etag??``};if(t?.kind===`directory`)return{kind:`directory`,size:0,mtime:t.lastModified??s.cachedAt};if(!t)throw new i(`ENOENT`,`no such file or directory`,e)}let c=await this.transport({method:`HEAD`,bucket:this.parsed.bucket,key:this.toS3Key(t)});if(c.status===200){let e=Number(c.headers.get(`content-length`)??`0`),t=c.headers.get(`etag`)??``,n=c.headers.get(`last-modified`);return{kind:`file`,size:e,mtime:n?Date.parse(n):0,etag:t}}if(c.status===404){let n=await this.cache.getListing(t);if(n)return{kind:`directory`,size:0,mtime:n.cachedAt};throw new i(`ENOENT`,`no such file or directory`,e)}throw new i(`EIO`,`s3 stat failed: ${c.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 i(`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 i(`ENOENT`,`no such file`,e);if(r.status===401||r.status===403)throw new i(`EACCES`,`s3 delete denied`,e);if(r.status>=400)throw new i(`EIO`,`s3 delete failed: ${r.status}`,e);await this.cache.invalidateBody(n);let a=n.split(`/`).slice(0,-1).join(`/`);await this.cache.invalidateListing(a)}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}},k=class extends Error{constructor(e){super(e),this.name=`ProfileNotConfiguredError`}};async function A(){let e=r().find(e=>e.providerId===`adobe`);if(!e?.accessToken)throw new k(`No Adobe IMS account found. Log in via Settings → Providers → Adobe first.`);return{identity:`adobe-ims`,getBearerToken:async()=>e.accessToken}}var j=n,M=t,N=new Set([`invalid_profile`,`invalid_request`,`profile_not_configured`,`fetch_failed`,`internal`]),P=new Set([101,103,204,205,304]);function F(e){if(!e.ok)throw e.errorCode===`profile_not_configured`||e.errorCode===`invalid_profile`?new i(`EACCES`,e.error):e.errorCode===`invalid_request`?new i(`EINVAL`,e.error):e.errorCode===`fetch_failed`||e.errorCode===`internal`||N.has(String(e.errorCode))?new i(`EIO`,e.error):new i(`EINVAL`,`mount transport returned unrecognized errorCode '${e.errorCode}': ${e.error}`);let t;try{t=j(e.bodyBase64)}catch(e){throw new i(`EIO`,`mount transport: response body decode failed: ${e instanceof Error?e.message:String(e)}`)}let n=P.has(e.status)?null:t;return new Response(n,{status:e.status,headers:new Headers(e.headers)})}async function I(e){throw new i(`EIO`,`mount transport unavailable: setMountCapabilityBroker was never called for this float (composition bug — refusing to guess a transport for a privileged sign-and-forward request)`)}function L(e){return async t=>F(await I({backend:`s3`,envelope:{profile:e,method:t.method,bucket:t.bucket,key:t.key,query:t.query,headers:t.headers,bodyBase64:t.body?M(t.body):void 0}}))}function R(e){let t=e?.getImsToken??(async()=>(await A()).getBearerToken());return async e=>{let n;try{n=await t()}catch(e){throw new i(`EACCES`,`DA mount: ${e instanceof Error?e.message:String(e)}`)}return F(await I({backend:`da`,envelope:{imsToken:n,method:e.method,path:e.path,origin:e.origin,query:e.query,headers:e.headers,bodyBase64:e.body?M(e.body):void 0}}))}}export{p as AemMountBackend,T as DaMountBackend,a as RemoteMountCache,O as S3MountBackend,R as makeSignedFetchDa,L as makeSignedFetchS3};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,i as n,n as r,s as i,t as a}from"./signed-fetch-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{a as t,i as n,n as r,s as i,t as a}from"./signed-fetch-DeDG40wV.js";import{t as o}from"./remote-cache-UwMD8EkX.js";var s=e({AEM_SOURCE_BUS_ORIGIN:()=>AEM_SOURCE_BUS_ORIGIN,AemMountBackend:()=>i,DaMountBackend:()=>t,RemoteMountCache:()=>o,S3MountBackend:()=>n,makeSignedFetchDa:()=>a,makeSignedFetchS3:()=>r});export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./port-bridge-client-
|
|
1
|
+
import{t as e}from"./port-bridge-client-DAxhsvxm.js";import{t}from"./types-D8gIX-W-.js";const n=e({portName:`mount.sign-and-forward`,panelRpcOp:`mount-sign-and-forward`,timeoutMs:12e4,onUnavailable:`reject`,makeError:e=>new t(`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 r(e,t){return n({type:e,envelope:t})}export{r as callMountBridge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./port-bridge-client-
|
|
1
|
+
import{t as e}from"./port-bridge-client-B-gpiOVR.js";import{t}from"./types-D8gIX-W-.js";var n=e({portName:`mount.sign-and-forward`,panelRpcOp:`mount-sign-and-forward`,timeoutMs:12e4,onUnavailable:`reject`,makeError:e=>new t(`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 r(e,t){return n({type:e,envelope:t})}export{r as callMountBridge};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/quick-llm-DTjkRv5O.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/compat-BAGLwgqY.js","assets/models-Xc0Gclrk.js","assets/diagnostics-Cag7MsZI.js","assets/preload-helper-Czpn1I53.js","assets/env-api-keys-BXRkymgV.js","assets/provider-env-CTOcDKrQ.js","assets/__vite-browser-external-5eBdwsFd.js","assets/openrouter.models-DHpsqCCC.js","assets/logger-DDBAeTLF.js","assets/account-store-DiRMol3Q.js","assets/core-Cx9N3lmn.js","assets/libesm-BypnjKEL.js","assets/feature-flags-DvsApnS-.js","assets/proxied-fetch-4VBgrEIu.js","assets/base64-ELzoYfwP.js","assets/proxy-error-BSFYY7jj.js","assets/api-endpoint-DuEQRZ4g.js","assets/runtime-env-Dlaokqg1.js","assets/secret-topology-hMRoGGjt.js","assets/float-topology-C_iRKPQK.js","assets/secrets-bridge-client-D734Xx8G.js","assets/port-bridge-client-B-gpiOVR.js","assets/panel-rpc-accessor-B4BfPLSo.js","assets/image-markers-q8JQTtid.js","assets/tool-ui-eSQ1g2I1.js","assets/providers-BAKMBUX7.js","assets/stored-accounts-ChNHYF68.js","assets/bedrock-camp-compat-B1oHsbyo.js","assets/bedrock-camp-extra-models-BYrxX19D.js","assets/claude-model-version-DZmbk9E2.js","assets/llm-session-id-bZQs6gBN.js","assets/icons-2DY2vYOc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Czpn1I53.js";import{t}from"./logger-DDBAeTLF.js";import{a as n}from"./feature-flags-DvsApnS-.js";import{m as r,z as i}from"./account-store-DiRMol3Q.js";import"./main-Bu5EcQ93.js";import{t as a}from"./llm-session-id-bZQs6gBN.js";import{F as o,G as s,I as c,L as l,R as u,W as d,z as f}from"./wc-live-WP25Nrx4.js";var p=t(`new-session`),m=`ui-new-session`,h=2e4,g=5e3,_=250;async function v(e){try{let t=await e.openVfs(),n=r()??void 0;if(!n)return;let o;try{o=i()}catch{return}let s=o.provider===`adobe`?{"X-Session-Id":a(m)}:void 0;await f({vfs:t,model:o,apiKey:n,headers:s}),e.onComplete?.()}catch(e){p.warn(`Pending session catch-up failed (boot continues)`,{error:e instanceof Error?e.message:String(e)})}}function y(e){(e.schedule??b)(()=>{v(e)})}function b(e){if(typeof globalThis.requestIdleCallback==`function`){globalThis.requestIdleCallback(e,{timeout:5e3});return}setTimeout(e,0)}function x(e){if(n(`agentic-memory`)){if(!e.agenticMemorySpawn){p.info(`Agentic memory enabled but agent bridge unavailable — using legacy enrichment`);return}return e.agenticMemorySpawn}}async function S(e,t,n,r,i,a){let o=await l({sessionStore:t,vfs:e.vfs,mode:`quick`,agenticMemorySpawn:a,cone:e.cone});return o?(await w(e,o),C(e,t,n,r,i,a,o),o):null}async function C(t,n,r,i,a,s,l){let u=l;try{let n=await c(t.vfs,l,{model:r,apiKey:i,headers:a,skipMemory:!0,pickIcon:t=>e(async()=>{let{pickLucideIcon:e}=await import(`./quick-llm-DTjkRv5O.js`).then(e=>e.n);return{pickLucideIcon: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,27,28,29,30,31,32,33])).then(({pickLucideIcon:e})=>e(t))});n&&(u={...n,archive:l.archive},t.onBackgroundEnriched?.(n))}catch(e){p.warn(`Agentic title enrichment threw (draft stays pending)`,{filename:l.filename,error:e instanceof Error?e.message:String(e)})}let d=await o({sessionStore:n,vfs:t.vfs,mode:`full`,model:r,apiKey:i,headers:a,agenticMemorySpawn:s,cone:t.cone},u).catch(e=>(p.warn(`Agentic memory curator threw (entry stays pending)`,{filename:u.filename,error:e instanceof Error?e.message:String(e)}),null));p.info(`Agentic memory curator finished`,{filename:u.filename,memoryPending:!d||d.memoryPending===!0}),t.onBackgroundEnriched?.(d),t.onSessionSettled?.(d??u)}async function w(e,t){if(!e.captureCompleteSnapshot)return;let n=new AbortController,r,i=new Promise((e,t)=>{r=setTimeout(()=>{n.abort(),t(Object.assign(Error(`Complete snapshot timed out`),{code:`snapshot-timeout`}))},g)});try{await Promise.race([e.captureCompleteSnapshot(t,n.signal),i])}catch(n){let r=n?.code??`unknown`;p.warn(`captureCompleteSnapshot failed`,{code:r}),t.completeSnapshotUnavailable=!0;try{await u(e.vfs,t.filename)}catch{}}finally{r&&clearTimeout(r)}}function T(e){return e?.code===`ENOENT`}function E(e,t){return e===t||t.startsWith(e.endsWith(`/`)?e:`${e}/`)}async function D(e,t,n,r){for(let i of n){let n=`${t}/${i.name}`;if(!r.has(n)){if(i.type===`directory`){let t;try{t=await e.readDir(n)}catch(e){if(T(e))continue;throw e}if(await D(e,n,t,r),[...r].some(e=>e.startsWith(`${n}/`)))continue}try{await e.rm(n)}catch(e){if(!T(e))throw e}}}}async function O(e,t){let n=(await e.listMountPoints()).map(({path:e})=>e);if(n.some(e=>E(e,t)))return;let r=new Set(n.filter(e=>e.startsWith(`${t}/`))),i;try{i=await e.readDir(t)}catch(n){if(n?.code!==`ENOENT`)throw n;await e.mkdir(t,{recursive:!0});return}await D(e,t,i,r),await e.mkdir(t,{recursive:!0})}async function k(t){let n=t.enrichmentRaceMs??h,o=r()??void 0,u;try{u=i()}catch(e){p.info(`No active model — freezing without LLM enrichment`,{error:e instanceof Error?e.message:String(e)})}let f=u?.provider===`adobe`?{"X-Session-Id":a(m)}:void 0,g=new s(new d),_=o&&u?x(t):void 0;if(_)return await S(t,g,u,o,f,_);let v=await l({sessionStore:g,vfs:t.vfs,mode:`quick`,cone:t.cone});if(!v)return null;if(await w(t,v),!o||!u)return p.info(`Frozen without enrichment (no LLM credentials) — left pending`,{filename:v.filename}),t.onSessionSettled?.(v),v;let y=u,b=c(t.vfs,v,{model:y,apiKey:o,headers:f,pickIcon:t=>e(async()=>{let{pickLucideIcon:e}=await import(`./quick-llm-DTjkRv5O.js`).then(e=>e.n);return{pickLucideIcon: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,27,28,29,30,31,32,33])).then(({pickLucideIcon:e})=>e(t))}).catch(e=>(p.warn(`Single-click enrichment threw (entry stays pending)`,{filename:v.filename,error:e instanceof Error?e.message:String(e)}),null)),C=await A(b,n,t.onProgress);if(C.kind===`llm`){let e=C.updated?{...C.updated,archive:v.archive}:v;return t.onSessionSettled?.(e),e}return b.then(e=>{p.info(`Background enrichment resolved after race window`,{filename:v.filename,enriched:e?.filename??null}),t.onBackgroundEnriched?.(e),t.onSessionSettled?.(e??v)}),v}async function A(e,t,n){let r=Date.now(),i,a;n?.(0),n&&(i=setInterval(()=>{n(Math.min(1,(Date.now()-r)/t))},_));let o=new Promise(e=>{a=setTimeout(()=>e({kind:`timer`}),t)}),s=e.then(e=>({kind:`llm`,updated:e}));try{return await Promise.race([s,o])}finally{i&&clearInterval(i),a&&clearTimeout(a),n?.(null)}}async function j(e){return N(e,void 0)}async function M(e){return N(e,`skip`)}async function N(e,t){let n=new s(new d),r=await l({sessionStore:n,vfs:e.vfs,mode:`quick`,cone:e.cone,...t?{memory:t}:{}});return r&&await w(e,r),r&&e.onSessionSettled?.(r),r}export{O as resetNewSessionTmp,M as runNewSessionArchiveOnly,k as runNewSessionFreeze,j as runNewSessionFreezeQuick,y as schedulePendingSessionCatchup};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/provider-DckNx7km.js","assets/preload-helper-Czpn1I53.js","assets/logger-DDBAeTLF.js","assets/account-store-DiRMol3Q.js","assets/core-Cx9N3lmn.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/compat-BAGLwgqY.js","assets/models-Xc0Gclrk.js","assets/diagnostics-Cag7MsZI.js","assets/env-api-keys-BXRkymgV.js","assets/provider-env-CTOcDKrQ.js","assets/__vite-browser-external-5eBdwsFd.js","assets/openrouter.models-DHpsqCCC.js","assets/libesm-BypnjKEL.js","assets/feature-flags-DvsApnS-.js","assets/proxied-fetch-4VBgrEIu.js","assets/base64-ELzoYfwP.js","assets/proxy-error-BSFYY7jj.js","assets/api-endpoint-DuEQRZ4g.js","assets/runtime-env-Dlaokqg1.js","assets/secret-topology-hMRoGGjt.js","assets/float-topology-C_iRKPQK.js","assets/secrets-bridge-client-D734Xx8G.js","assets/port-bridge-client-B-gpiOVR.js","assets/panel-rpc-accessor-B4BfPLSo.js","assets/image-markers-q8JQTtid.js","assets/tool-ui-eSQ1g2I1.js","assets/providers-BAKMBUX7.js","assets/stored-accounts-ChNHYF68.js","assets/bedrock-camp-compat-B1oHsbyo.js","assets/bedrock-camp-extra-models-BYrxX19D.js","assets/claude-model-version-DZmbk9E2.js","assets/global-db-CbuLl-zx.js","assets/bridge-token-required-DMk2va9k.js","assets/pkce-hGf_TEnP.js","assets/types-D8gIX-W-.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Czpn1I53.js";import{t}from"./logger-DDBAeTLF.js";import{W as n,u as r}from"./account-store-DiRMol3Q.js";import{t as i}from"./providers-BAKMBUX7.js";import"./main-Bu5EcQ93.js";import"./logger-BoSvu4mW.js";var a=t(`oauth-bootstrap`),o=6e4;function s(e){return e instanceof Error?e.message:String(e)}async function c(){try{let{ensureAllMcpProvidersRegistered:t}=await e(async()=>{let{ensureAllMcpProvidersRegistered:e}=await import(`./provider-DckNx7km.js`);return{ensureAllMcpProvidersRegistered: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,27,28,29,30,31,32,33,34,35])),n=await t();n.length>0&&a.debug(`Pre-registered MCP providers for OAuth bootstrap`,{count:n.length})}catch(e){a.warn(`Failed to pre-register MCP providers for OAuth bootstrap`,{error:s(e)})}}function l(e){return(e.tokenExpiresAt??1/0)-Date.now()<=o}async function u(e){let t=i(e.providerId);if(!t?.onSilentRenew){a.debug(`Skipping expired account (no silent-renew hook)`,{providerId:e.providerId});return}try{if(await t.onSilentRenew()){a.info(`Silently renewed OAuth token`,{providerId:e.providerId});return}a.warn(`Silent renewal yielded no token; user must re-authenticate`,{providerId:e.providerId})}catch(t){a.warn(`Silent renewal failed`,{providerId:e.providerId,error:s(t)})}}async function d(e,t){try{await n({providerId:e.providerId,accessToken:t,refreshToken:e.refreshToken,tokenExpiresAt:e.tokenExpiresAt,userName:e.userName,userAvatar:e.userAvatar}),a.debug(`Bootstrapped OAuth replica`,{providerId:e.providerId})}catch(t){a.error(`OAuth bootstrap failed`,{providerId:e.providerId,error:s(t)})}}async function f(e){let t=e.accessToken;if(!t){a.debug(`Skipping account without token`,{providerId:e.providerId});return}if(l(e)){await u(e);return}await d(e,t)}async function p(){await c();let e=r();a.info(`Bootstrap OAuth replicas`,{count:e.length});for(let t of e)await f(t)}export{p as bootstrapOAuthReplicas};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./preload-helper-Czpn1I53.js";import"./proxied-fetch-4VBgrEIu.js";import{n as t}from"./runtime-env-Dlaokqg1.js";import{s as n,t as r}from"./api-endpoint-DuEQRZ4g.js";import{t as i}from"./panel-rpc-accessor-B4BfPLSo.js";import{t as a}from"./permissions-surface-registry-CilCRwhh.js";var o=12e4;function s(e){let t=e.requestId,n=e.request;if(typeof t!=`string`||typeof n!=`object`||!n||Array.isArray(n))return null;let r=n;if(typeof r.url!=`string`||typeof r.method!=`string`)return null;let i=typeof r.headers==`object`&&r.headers!==null&&!Array.isArray(r.headers)?r.headers:{};return{requestId:t,request:{url:r.url,method:r.method,headers:i},resourceType:typeof e.resourceType==`string`?e.resourceType:void 0,frameId:typeof e.frameId==`string`?e.frameId:void 0}}function c(e,t){return t.endsWith(`*`)?e.startsWith(t.slice(0,-1)):e===t||e.startsWith(`${t}?`)||e.startsWith(`${t}#`)}function l(e){return e.endsWith(`*`)?e:`${e}*`}function u(e,t){if(!t||t.length===0)return e;let n=e;for(let e of t)if(n.includes(e.match)){if(e.replaceUrl){n=e.replaceUrl;continue}if(e.appendParams)try{let t=new URL(n);for(let[n,r]of Object.entries(e.appendParams))t.searchParams.set(n,r);n=t.toString()}catch{}}return n}function d(e){return async t=>{let n=t.timeoutMs??o,r=t.rewrite??[],i=t.onCapture??`close`,a,d,f=!1,p=null,m=async()=>{if(d){try{await e.send(`Fetch.disable`,{},d)}catch{}try{await e.send(`Target.detachFromTarget`,{sessionId:d})}catch{}}if(a&&i===`close`)try{await e.send(`Target.closeTarget`,{targetId:a})}catch{}};return await new Promise(i=>{let o=async t=>{f||(f=!0,clearTimeout(g),e.off(`Fetch.requestPaused`,h),await m(),i(t))},h=n=>{let i=s(n);if(!i?.request.url||!d||(typeof n.sessionId==`string`?n.sessionId:void 0)!==d)return;if(c(i.request.url,t.redirectUriPattern)){p=i.request.url,e.send(`Fetch.failRequest`,{requestId:i.requestId,errorReason:`Aborted`},d).catch(()=>{}),o(p).catch(()=>{});return}let a=u(i.request.url,r);if(a!==i.request.url){e.send(`Fetch.continueRequest`,{requestId:i.requestId,url:a},d).catch(e=>{console.warn(`[intercepted-oauth] continueRequest (rewrite) failed:`,e instanceof Error?e.message:String(e))});return}e.send(`Fetch.continueRequest`,{requestId:i.requestId},d).catch(()=>{})},g=setTimeout(()=>{o(null).catch(()=>{})},n);(async()=>{a=(await e.send(`Target.createTarget`,{url:`about:blank`})).targetId,d=(await e.send(`Target.attachToTarget`,{targetId:a,flatten:!0})).sessionId,e.on(`Fetch.requestPaused`,h),await e.send(`Fetch.enable`,{patterns:[{urlPattern:l(t.redirectUriPattern),requestStage:`Request`},...r.map(e=>({urlPattern:`*${e.match}*`,requestStage:`Request`}))]},d),await e.send(`Page.navigate`,{url:t.authorizeUrl},d)})().catch(e=>{console.error(`[intercepted-oauth] setup failed:`,e instanceof Error?e.message:String(e)),o(null).catch(()=>{})})})}}var f=t(),p=class extends Error{constructor(e){super(e),this.name=`OAuthLaunchError`}};async function m(){if(typeof window<`u`)return!1;let e=i();if(!e)return!1;try{return(await e.call(`oauth-route`,{},{timeoutMs:5e3})).delegate===!0}catch{return!1}}function h(){return f?T:typeof window>`u`?y:b}async function g(){let e=await _();return e?d(e):null}async function _(){try{let{getActiveCdpTransport:t}=await e(async()=>{let{getActiveCdpTransport:e}=await import(`./active-transport-BIjzxdwv.js`);return{getActiveCdpTransport:e}},[]);return await t()}catch(e){return console.warn(`[oauth-service] could not resolve active CDP transport:`,e instanceof Error?e.message:String(e)),null}}async function v(){if(typeof window<`u`)return{origin:window.location.origin,href:window.location.href};let e=i();if(!e)throw Error(`OAuth from worker context requires the panel-RPC bridge (no page-info available)`);let t=await e.call(`page-info`,void 0);return{origin:t.origin,href:t.href}}async function y(e){let t=i();if(!t)return console.error(`[oauth-service] panel-RPC client unavailable in worker`),null;try{let n=await t.call(`oauth-popup`,{url:e},{timeoutMs:13e4});if(!n.redirectUrl&&n.error)throw new p(n.error);return n.redirectUrl}catch(e){if(e instanceof p)throw e;return console.error(`[oauth-service] oauth-popup RPC failed:`,e instanceof Error?e.message:String(e)),null}}async function b(e){if(x())return S(window.open(e,`_blank`,`width=500,height=700,popup=yes`));let t=a();if(t){let n=await C(t,e);return n===void 0?null:S(n)}return S(window.open(e,`_blank`,`width=500,height=700,popup=yes`))}function x(){return(typeof navigator<`u`?navigator.userActivation:void 0)?.isActive===!0}function S(e){return new Promise(t=>{let i=!1,a=null,o=null,s=()=>{i||(i=!0,window.removeEventListener(`message`,c),clearTimeout(l),a&&clearInterval(a),o&&clearInterval(o))},c=n=>{if(n.data?.type!==`oauth-callback`||n.origin!==window.location.origin||e&&n.source!==e)return;if(s(),n.data.error){console.error(`[oauth-service] CLI OAuth error:`,n.data.error),t(null);return}let r=n.data.redirectUrl;(typeof r==`string`||r==null)&&t(r??null)};window.addEventListener(`message`,c),a=setInterval(async()=>{if(!i)try{let e=await fetch(n(`/api/oauth-result`),{headers:r()});if(e.status===204||!e.ok)return;let a=await e.json();if(i)return;if(s(),a.error){console.error(`[oauth-service] Server relay OAuth error:`,a.error),t(null);return}t(a.redirectUrl??null)}catch(e){console.warn(`[oauth-service] Poll failed:`,e instanceof Error?e.message:String(e))}},1e3),e&&(o=setInterval(()=>{e.closed&&(clearInterval(o),o=null,setTimeout(()=>{i||(s(),t(null))},1500))},500));let l=setTimeout(()=>{s();try{e?.close()}catch{}t(null)},12e4)})}async function C(e,t){let n=await e.prompt({kinds:[`popup`],description:`Continue to sign in. A new window will open to the provider.`,grantLabel:`Continue`,requestOptions:{popup:{url:t}}});if(n.status!==`granted`)return;let r=n.grants.find(e=>e.kind===`popup`);return r&&r.kind===`popup`?r.window:null}async function w(e,t=18e4){if(typeof window>`u`||f)return;let n=window.open(e,`_blank`,`width=500,height=600,popup=yes`);if(!n){console.warn(`[oauth-service] Could not open IdP logout popup — popups may be blocked`);return}await new Promise(e=>{let r=setTimeout(()=>{clearInterval(i);try{n.close()}catch{}e()},t),i=setInterval(()=>{n.closed&&(clearTimeout(r),clearInterval(i),e())},500)})}async function T(e,t){let n=chrome.runtime;return new Promise(r=>{let i=!1,a=()=>{i||(i=!0,n.onMessage.removeListener(o),clearTimeout(s))},o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(t.source===`service-worker`&&t.payload?.type===`oauth-result`){if(a(),t.payload.error){console.error(`[oauth-service] Extension OAuth error:`,t.payload.error),r(null);return}r(t.payload.redirectUrl??null)}};n.onMessage.addListener(o),n.sendMessage({source:`panel`,payload:{type:`oauth-request`,providerId:`oauth`,authorizeUrl:e,interactive:t?.interactive??!0}}).catch(e=>{console.error(`[oauth-service] Failed to send OAuth request to service worker:`,e)});let s=setTimeout(()=>{a(),r(null)},12e4)})}export{g as createInterceptingOAuthLauncherForCurrentRuntime,h as createOAuthLauncher,v as getOAuthPageOrigin,w as openIdpLogoutUrl,m as resolveOAuthDelegation};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./proxied-fetch-F-dCBEfh.js";import{t as e}from"./runtime-env-DadgceZk.js";import{t}from"./panel-rpc-accessor-B4BfPLSo.js";import{s as n,t as r}from"./api-endpoint-D8lUKmPu.js";import{t as i}from"./permissions-surface-registry-BqPdUk9w.js";import{t as a}from"./intercepted-oauth-B0tP4D7f.js";const o=e();var s=class extends Error{constructor(e){super(e),this.name=`OAuthLaunchError`}};async function c(){if(typeof window<`u`)return!1;let e=t();if(!e)return!1;try{return(await e.call(`oauth-route`,{},{timeoutMs:5e3})).delegate===!0}catch{return!1}}function l(){return o?y:typeof window>`u`?p:m}async function u(){let e=await d();return e?a(e):null}async function d(){try{let{getActiveCdpTransport:e}=await import(`./active-transport-BIjzxdwv.js`);return await e()}catch(e){return console.warn(`[oauth-service] could not resolve active CDP transport:`,e instanceof Error?e.message:String(e)),null}}async function f(){if(typeof window<`u`)return{origin:window.location.origin,href:window.location.href};let e=t();if(!e)throw Error(`OAuth from worker context requires the panel-RPC bridge (no page-info available)`);let n=await e.call(`page-info`,void 0);return{origin:n.origin,href:n.href}}async function p(e){let n=t();if(!n)return console.error(`[oauth-service] panel-RPC client unavailable in worker`),null;try{let t=await n.call(`oauth-popup`,{url:e},{timeoutMs:13e4});if(!t.redirectUrl&&t.error)throw new s(t.error);return t.redirectUrl}catch(e){if(e instanceof s)throw e;return console.error(`[oauth-service] oauth-popup RPC failed:`,e instanceof Error?e.message:String(e)),null}}async function m(e){if(h())return g(window.open(e,`_blank`,`width=500,height=700,popup=yes`));let t=i();if(t){let n=await _(t,e);return n===void 0?null:g(n)}return g(window.open(e,`_blank`,`width=500,height=700,popup=yes`))}function h(){return(typeof navigator<`u`?navigator.userActivation:void 0)?.isActive===!0}function g(e){return new Promise(t=>{let i=!1,a=null,o=null,s=()=>{i||(i=!0,window.removeEventListener(`message`,c),clearTimeout(l),a&&clearInterval(a),o&&clearInterval(o))},c=n=>{if(n.data?.type!==`oauth-callback`||n.origin!==window.location.origin||e&&n.source!==e)return;if(s(),n.data.error){console.error(`[oauth-service] CLI OAuth error:`,n.data.error),t(null);return}let r=n.data.redirectUrl;(typeof r==`string`||r==null)&&t(r??null)};window.addEventListener(`message`,c),a=setInterval(async()=>{if(!i)try{let e=await fetch(n(`/api/oauth-result`),{headers:r()});if(e.status===204||!e.ok)return;let a=await e.json();if(i)return;if(s(),a.error){console.error(`[oauth-service] Server relay OAuth error:`,a.error),t(null);return}t(a.redirectUrl??null)}catch(e){console.warn(`[oauth-service] Poll failed:`,e instanceof Error?e.message:String(e))}},1e3),e&&(o=setInterval(()=>{e.closed&&(clearInterval(o),o=null,setTimeout(()=>{i||(s(),t(null))},1500))},500));let l=setTimeout(()=>{s();try{e?.close()}catch{}t(null)},12e4)})}async function _(e,t){let n=await e.prompt({kinds:[`popup`],description:`Continue to sign in. A new window will open to the provider.`,grantLabel:`Continue`,requestOptions:{popup:{url:t}}});if(n.status!==`granted`)return;let r=n.grants.find(e=>e.kind===`popup`);return r&&r.kind===`popup`?r.window:null}async function v(e,t=18e4){if(typeof window>`u`||o)return;let n=window.open(e,`_blank`,`width=500,height=600,popup=yes`);if(!n){console.warn(`[oauth-service] Could not open IdP logout popup — popups may be blocked`);return}await new Promise(e=>{let r=setTimeout(()=>{clearInterval(i);try{n.close()}catch{}e()},t),i=setInterval(()=>{n.closed&&(clearTimeout(r),clearInterval(i),e())},500)})}async function y(e,t){let n=chrome.runtime;return new Promise(r=>{let i=!1,a=()=>{i||(i=!0,n.onMessage.removeListener(o),clearTimeout(s))},o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(t.source===`service-worker`&&t.payload?.type===`oauth-result`){if(a(),t.payload.error){console.error(`[oauth-service] Extension OAuth error:`,t.payload.error),r(null);return}r(t.payload.redirectUrl??null)}};n.onMessage.addListener(o),n.sendMessage({source:`panel`,payload:{type:`oauth-request`,providerId:`oauth`,authorizeUrl:e,interactive:t?.interactive??!0}}).catch(e=>{console.error(`[oauth-service] Failed to send OAuth request to service worker:`,e)});let s=setTimeout(()=>{a(),r(null)},12e4)})}export{u as createInterceptingOAuthLauncherForCurrentRuntime,l as createOAuthLauncher,f as getOAuthPageOrigin,v as openIdpLogoutUrl,c as resolveOAuthDelegation};
|
package/dist/ui/assets/{onboarding-orchestrator-BLrUNStK.js → onboarding-orchestrator-DJBNgmTb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./slugify-BYJ6QVAt.js";import{i as n}from"./wc-onboarding-BJrwUBcv.js";var r={openai:{url:e=>`${(e??`https://api.openai.com`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},anthropic:{url:e=>`${(e??`https://api.anthropic.com`).replace(/\/$/,``)}/v1/models`,headers:e=>({"x-api-key":e,"anthropic-version":`2023-06-01`})},groq:{url:e=>`${(e??`https://api.groq.com/openai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},cerebras:{url:e=>`${(e??`https://api.cerebras.ai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},mistral:{url:e=>`${(e??`https://api.mistral.ai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},"x-ai":{url:e=>`${(e??`https://api.x.ai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},deepseek:{url:e=>`${(e??`https://api.deepseek.com`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},openrouter:{url:e=>`${(e??`https://openrouter.ai/api`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},google:{url:e=>`${(e??`https://generativelanguage.googleapis.com`).replace(/\/$/,``)}/v1beta/models`,headers:()=>({})}};function i(e,t){if(e===401||e===403)return`Authentication failed — the key was rejected by the provider.`;if(e===404)return`Endpoint not found — check the base URL.`;if(e===429)return`Rate-limited — try again in a moment.`;if(e>=500)return`Provider returned a server error.`;let n=t.trim();return n?`${e}: ${n.slice(0,160)}`:`Provider responded with HTTP ${e}.`}async function a(e){let{provider:t,apiKey:n,baseUrl:a,signal:o}=e,s=e.fetchImpl??fetch,c=n.trim();if(!c)return{kind:`failed`,status:null,message:`API key is empty.`};let l=r[t];if(!l)return{kind:`skipped`,reason:`No live validation available for "${t}" — saving without testing.`};let u=l.url(a);if(t===`google`){let e=u.includes(`?`)?`&`:`?`;u=`${u}${e}key=${encodeURIComponent(c)}`}try{let e=await s(u,{method:`GET`,headers:l.headers(c),signal:o});if(e.ok)return{kind:`ok`};let t=``;try{t=await e.text()}catch{}return e.status===401||e.status,{kind:`failed`,status:e.status,message:i(e.status,t)}}catch(e){if(e?.name===`AbortError`)throw e;return{kind:`skipped`,reason:`Couldn't reach the provider (${e instanceof Error?e.message:String(e)}). Saving without live test — you can retry from Settings.`}}}var o=[e=>`Nice to meet you, ${e}.`,e=>`Hello ${e} — glad you stopped by.`,e=>`Hey ${e}, welcome aboard.`,e=>`${e}! Pleasure to make your acquaintance.`],s=[`Nice to meet you, mysterious stranger — I'll respect the incognito.`,`Hello, anonymous traveler. You can always tell me your name later if you change your mind.`,`An unnamed visitor — intriguing. Whenever you'd like to introduce yourself, just say the word.`,`Hey there, ghost — happy to keep things first-name-optional. The door's always open if you decide to drop the cloak.`],c={work:[`Work mode — let's make today productive.`,`On the clock? Same. Let's chip away at it.`],school:[`School business — I love a good study session.`,`Hitting the books? Glad to ride along.`],personal:[`Personal project energy is the best kind.`,`Tinkering for yourself is how the good stuff happens.`],"side-project":[`Side projects keep the lights on creatively.`,`Two-job life — respect.`],exploring:[`Just poking around? Excellent. The best discoveries start there.`,`Exploration mode — no agenda, no pressure.`]},l={developer:[`I can write code, run shell commands, drive a real browser, and ship pages.`,`Code, terminals, browsers, repos — I live in all of them.`],designer:[`I can prototype layouts, generate assets, and walk page editors with you.`,`Pixels, components, screenshots — design ops are my jam.`],"content-creator":[`I can draft copy, edit, scrape references, and stitch publish-ready pages.`,`Words, structure, SEO, polish — say the topic and I'll get moving.`],marketer:[`I can audit funnels, scrape competitors, and stand up landing pages quickly.`,`Campaigns, analytics, creatives — plug me in and I'll go.`],"product-pm":[`I can summarise research, draft specs, and crunch competitive intel.`,`Briefs, roadmaps, comparisons — I take the boring half off your plate.`],founder:[`I can prototype landing pages, automate ops, and prep investor decks.`,`Idea → MVP → repeat. I'll do the legwork between coffee refills.`],student:[`I can read papers with you, draft notes, and turn lectures into outlines.`,`Studying together makes it bearable — let me handle the busywork.`],researcher:[`I can scrape sources, summarise findings, and keep a running bibliography.`,`Lit reviews, datasets, write-ups — I'm all in.`],other:[`I'm flexible — give me a task and I'll figure out the right tools.`,`Whatever the role, I can probably help. Tell me what's on the docket.`]},u=[`I can browse the web, run commands, write code, and automate the boring parts.`,`I'm comfortable with terminals, browsers, files, and a long backlog of skills.`],d=[`But to be honest, I'm not really an AI yet — I'm an empty shell. You'll need to help me become intelligent. Pick a model and I'll wake up:`,`Confession time: I can't actually think yet. Wire me up to an LLM and I'll start earning my keep:`,`Plot twist — there's no brain in here. Choose a provider so I can do more than read this script:`,`Truthfully? I'm a very polite placeholder until you give me a model. Help me out:`];function f(e,t){return e[Math.floor(t()*e.length)%e.length]}function p(e){return e.replace(/-/g,` `)}function m(e){if(e.length===0)return``;if(e.length===1)return e[0];if(e.length===2)return`${e[0]} and ${e[1]}`;let t=e[e.length-1];return`${e.slice(0,-1).join(`, `)}, and ${t}`}function h(e,t=Math.random){let n=(e.name||``).trim(),r=e.purpose?c[e.purpose]:void 0;return n?`${f(o,t)(n)}${r?` ${f(r,t)}`:``}`:`${f(s,t)}${r?` ${f(r,t)}`:``}`}function g(e,t=Math.random){let n=e.role&&l[e.role]?e.role:``,r=f(n?l[n]:u,t),i=(e.tasks??[]).slice(0,3).map(p);return`I'm sliccy. ${r}${i.length>0?` Especially handy for ${m(i)}.`:``} I'm an AI agent.`}function _(e,t=Math.random){return f(d,t)}function v(e,t=Math.random){return[h(e,t),g(e,t),_(e,t)]}var y=e(`onboarding-orchestrator`),b=class{deps;stage=`idle`;profile={};constructor(e){this.deps=e}getStage(){return this.stage}getProfile(){return{...this.profile}}handleFirstRun(){this.stage===`idle`&&(this.stage=`collect-profile`,this.deps.postDipReference(`Welcome to SLICC — let's get you set up.`),this.deps.postDipReference(``))}async handleOnboardingComplete(e){if(this.stage!==`idle`&&this.stage!==`collect-profile`)return y.debug(`Ignoring duplicate onboarding-complete`,{stage:this.stage}),!0;this.profile=e??{},this.stage=`awaiting-connect`,n(this.deps.fs).catch(e=>y.warn(`recordWelcomed failed`,e)),this.persistProfile(this.profile).catch(e=>y.warn(`persistProfile failed`,e));let t=v(this.profile,this.deps.rand);for(let e of t)this.deps.postSystemMessage(e);return this.deps.postDipReference(``),!0}handleConnectReady(){if(this.stage===`complete`)return;let e=this.deps.getProviderCatalogue();this.deps.broadcastToDip({type:`slicc-providers`,providers:e.providers,models:e.models})}async handleConnectAttempt(e){if(this.stage===`complete`)return;this.stage=`connecting`;let{provider:t,apiKey:n,baseUrl:r,deployment:i,apiVersion:o,model:s}=e;if(!t||typeof n!=`string`||!n.trim()){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`Provider and API key are required.`}),this.stage=`awaiting-connect`;return}let c=this.validateProviderRequiredFields(t,r,i);if(c){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:c}),this.stage=`awaiting-connect`;return}let l;try{l=await a({provider:t,apiKey:n.trim(),baseUrl:r??void 0,fetchImpl:this.deps.fetchImpl})}catch(e){y.warn(`validateApiKey threw`,e),this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`Validation request was aborted.`}),this.stage=`awaiting-connect`;return}if(l.kind===`failed`){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:l.message}),this.stage=`awaiting-connect`;return}let u=s||null;if(!u)try{let e=this.deps.getProviderCatalogue().models?.[t]?.[0]?.id;e&&(u=e)}catch(e){y.warn(`Failed to resolve fallback model for provider`,{provider:t,err:e})}try{this.deps.saveAccount(t,n.trim(),r?.trim()||void 0,i?.trim()||void 0,o?.trim()||void 0),u&&this.deps.setSelectedModel(x(t,u))}catch(e){y.warn(`saveAccount failed`,e),this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`Failed to save credentials locally.`}),this.stage=`awaiting-connect`;return}try{this.deps.onAccountsChanged?.()}catch(e){y.warn(`onAccountsChanged threw`,e)}let d=l.kind===`skipped`?`Saved — ${l.reason}`:`Validated against the provider. Ready when you are.`;this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!0,kind:l.kind,note:d});let f=u&&this.deps.resolveModelLabel?.(t,u)?this.deps.resolveModelLabel?.(t,u):u||null;this.stage=`complete`,this.deps.fireFinalLick({action:`onboarding-complete-with-provider`,data:{profile:this.profile,provider:t,model:u??null,modelLabel:f,validation:l.kind}})}async handleOAuthAttempt(e){if(this.stage===`complete`)return;if(!this.deps.launchOAuth){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`OAuth login is not available in this runtime.`});return}this.stage=`connecting`;let t;try{t=await this.deps.launchOAuth(e.provider,e.baseUrl??null)}catch(e){y.warn(`launchOAuth threw`,e),this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:e instanceof Error?e.message:`Login was cancelled.`}),this.stage=`awaiting-connect`;return}if(!t.ok){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:t.message||`Login was cancelled.`}),this.stage=`awaiting-connect`;return}if(t.model)try{this.deps.setSelectedModel(x(e.provider,t.model))}catch(e){y.warn(`setSelectedModel after OAuth failed`,e)}try{this.deps.onAccountsChanged?.()}catch(e){y.warn(`onAccountsChanged threw`,e)}this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!0,kind:`ok`,note:t.message||`Logged in.`});let n=t.model&&this.deps.resolveModelLabel?.(e.provider,t.model)?this.deps.resolveModelLabel?.(e.provider,t.model):t.model??null;this.stage=`complete`,this.deps.fireFinalLick({action:`onboarding-complete-with-provider`,data:{profile:this.profile,provider:e.provider,model:t.model??null,modelLabel:n,validation:`oauth`}})}validateProviderRequiredFields(e,t,n){let r;try{r=this.deps.getProviderCatalogue().providers.find(t=>t.id===e)}catch(e){return y.warn(`getProviderCatalogue threw during required-field gate`,e),`Could not load provider requirements. Please try again.`}return r?.requiresDeployment&&!n?.trim()?`${r.name} requires a deployment name.`:r?.requiresBaseUrl&&!t?.trim()?`${r.name} requires a base URL.`:null}async persistProfile(e){let n=t(e.name||`user`,{fallback:`user`});await this.deps.fs.writeFile(`/home/${n}/.welcome.json`,JSON.stringify(e,null,2))}};function x(e,t){return t.startsWith(`${e}:`)?t:`${e}:${t}`}export{b as OnboardingOrchestrator};
|
|
1
|
+
import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./slugify-BYJ6QVAt.js";import{i as n}from"./wc-onboarding-g_I2jf5C.js";var r={openai:{url:e=>`${(e??`https://api.openai.com`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},anthropic:{url:e=>`${(e??`https://api.anthropic.com`).replace(/\/$/,``)}/v1/models`,headers:e=>({"x-api-key":e,"anthropic-version":`2023-06-01`})},groq:{url:e=>`${(e??`https://api.groq.com/openai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},cerebras:{url:e=>`${(e??`https://api.cerebras.ai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},mistral:{url:e=>`${(e??`https://api.mistral.ai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},"x-ai":{url:e=>`${(e??`https://api.x.ai`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},deepseek:{url:e=>`${(e??`https://api.deepseek.com`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},openrouter:{url:e=>`${(e??`https://openrouter.ai/api`).replace(/\/$/,``)}/v1/models`,headers:e=>({Authorization:`Bearer ${e}`})},google:{url:e=>`${(e??`https://generativelanguage.googleapis.com`).replace(/\/$/,``)}/v1beta/models`,headers:()=>({})}};function i(e,t){if(e===401||e===403)return`Authentication failed — the key was rejected by the provider.`;if(e===404)return`Endpoint not found — check the base URL.`;if(e===429)return`Rate-limited — try again in a moment.`;if(e>=500)return`Provider returned a server error.`;let n=t.trim();return n?`${e}: ${n.slice(0,160)}`:`Provider responded with HTTP ${e}.`}async function a(e){let{provider:t,apiKey:n,baseUrl:a,signal:o}=e,s=e.fetchImpl??fetch,c=n.trim();if(!c)return{kind:`failed`,status:null,message:`API key is empty.`};let l=r[t];if(!l)return{kind:`skipped`,reason:`No live validation available for "${t}" — saving without testing.`};let u=l.url(a);if(t===`google`){let e=u.includes(`?`)?`&`:`?`;u=`${u}${e}key=${encodeURIComponent(c)}`}try{let e=await s(u,{method:`GET`,headers:l.headers(c),signal:o});if(e.ok)return{kind:`ok`};let t=``;try{t=await e.text()}catch{}return e.status===401||e.status,{kind:`failed`,status:e.status,message:i(e.status,t)}}catch(e){if(e?.name===`AbortError`)throw e;return{kind:`skipped`,reason:`Couldn't reach the provider (${e instanceof Error?e.message:String(e)}). Saving without live test — you can retry from Settings.`}}}var o=[e=>`Nice to meet you, ${e}.`,e=>`Hello ${e} — glad you stopped by.`,e=>`Hey ${e}, welcome aboard.`,e=>`${e}! Pleasure to make your acquaintance.`],s=[`Nice to meet you, mysterious stranger — I'll respect the incognito.`,`Hello, anonymous traveler. You can always tell me your name later if you change your mind.`,`An unnamed visitor — intriguing. Whenever you'd like to introduce yourself, just say the word.`,`Hey there, ghost — happy to keep things first-name-optional. The door's always open if you decide to drop the cloak.`],c={work:[`Work mode — let's make today productive.`,`On the clock? Same. Let's chip away at it.`],school:[`School business — I love a good study session.`,`Hitting the books? Glad to ride along.`],personal:[`Personal project energy is the best kind.`,`Tinkering for yourself is how the good stuff happens.`],"side-project":[`Side projects keep the lights on creatively.`,`Two-job life — respect.`],exploring:[`Just poking around? Excellent. The best discoveries start there.`,`Exploration mode — no agenda, no pressure.`]},l={developer:[`I can write code, run shell commands, drive a real browser, and ship pages.`,`Code, terminals, browsers, repos — I live in all of them.`],designer:[`I can prototype layouts, generate assets, and walk page editors with you.`,`Pixels, components, screenshots — design ops are my jam.`],"content-creator":[`I can draft copy, edit, scrape references, and stitch publish-ready pages.`,`Words, structure, SEO, polish — say the topic and I'll get moving.`],marketer:[`I can audit funnels, scrape competitors, and stand up landing pages quickly.`,`Campaigns, analytics, creatives — plug me in and I'll go.`],"product-pm":[`I can summarise research, draft specs, and crunch competitive intel.`,`Briefs, roadmaps, comparisons — I take the boring half off your plate.`],founder:[`I can prototype landing pages, automate ops, and prep investor decks.`,`Idea → MVP → repeat. I'll do the legwork between coffee refills.`],student:[`I can read papers with you, draft notes, and turn lectures into outlines.`,`Studying together makes it bearable — let me handle the busywork.`],researcher:[`I can scrape sources, summarise findings, and keep a running bibliography.`,`Lit reviews, datasets, write-ups — I'm all in.`],other:[`I'm flexible — give me a task and I'll figure out the right tools.`,`Whatever the role, I can probably help. Tell me what's on the docket.`]},u=[`I can browse the web, run commands, write code, and automate the boring parts.`,`I'm comfortable with terminals, browsers, files, and a long backlog of skills.`],d=[`But to be honest, I'm not really an AI yet — I'm an empty shell. You'll need to help me become intelligent. Pick a model and I'll wake up:`,`Confession time: I can't actually think yet. Wire me up to an LLM and I'll start earning my keep:`,`Plot twist — there's no brain in here. Choose a provider so I can do more than read this script:`,`Truthfully? I'm a very polite placeholder until you give me a model. Help me out:`];function f(e,t){return e[Math.floor(t()*e.length)%e.length]}function p(e){return e.replace(/-/g,` `)}function m(e){if(e.length===0)return``;if(e.length===1)return e[0];if(e.length===2)return`${e[0]} and ${e[1]}`;let t=e[e.length-1];return`${e.slice(0,-1).join(`, `)}, and ${t}`}function h(e,t=Math.random){let n=(e.name||``).trim(),r=e.purpose?c[e.purpose]:void 0;return n?`${f(o,t)(n)}${r?` ${f(r,t)}`:``}`:`${f(s,t)}${r?` ${f(r,t)}`:``}`}function g(e,t=Math.random){let n=e.role&&l[e.role]?e.role:``,r=f(n?l[n]:u,t),i=(e.tasks??[]).slice(0,3).map(p);return`I'm sliccy. ${r}${i.length>0?` Especially handy for ${m(i)}.`:``} I'm an AI agent.`}function _(e,t=Math.random){return f(d,t)}function v(e,t=Math.random){return[h(e,t),g(e,t),_(e,t)]}var y=e(`onboarding-orchestrator`),b=class{deps;stage=`idle`;profile={};constructor(e){this.deps=e}getStage(){return this.stage}getProfile(){return{...this.profile}}handleFirstRun(){this.stage===`idle`&&(this.stage=`collect-profile`,this.deps.postDipReference(`Welcome to SLICC — let's get you set up.`),this.deps.postDipReference(``))}async handleOnboardingComplete(e){if(this.stage!==`idle`&&this.stage!==`collect-profile`)return y.debug(`Ignoring duplicate onboarding-complete`,{stage:this.stage}),!0;this.profile=e??{},this.stage=`awaiting-connect`,n(this.deps.fs).catch(e=>y.warn(`recordWelcomed failed`,e)),this.persistProfile(this.profile).catch(e=>y.warn(`persistProfile failed`,e));let t=v(this.profile,this.deps.rand);for(let e of t)this.deps.postSystemMessage(e);return this.deps.postDipReference(``),!0}handleConnectReady(){if(this.stage===`complete`)return;let e=this.deps.getProviderCatalogue();this.deps.broadcastToDip({type:`slicc-providers`,providers:e.providers,models:e.models})}async handleConnectAttempt(e){if(this.stage===`complete`)return;this.stage=`connecting`;let{provider:t,apiKey:n,baseUrl:r,deployment:i,apiVersion:o,model:s}=e;if(!t||typeof n!=`string`||!n.trim()){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`Provider and API key are required.`}),this.stage=`awaiting-connect`;return}let c=this.validateProviderRequiredFields(t,r,i);if(c){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:c}),this.stage=`awaiting-connect`;return}let l;try{l=await a({provider:t,apiKey:n.trim(),baseUrl:r??void 0,fetchImpl:this.deps.fetchImpl})}catch(e){y.warn(`validateApiKey threw`,e),this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`Validation request was aborted.`}),this.stage=`awaiting-connect`;return}if(l.kind===`failed`){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:l.message}),this.stage=`awaiting-connect`;return}let u=s||null;if(!u)try{let e=this.deps.getProviderCatalogue().models?.[t]?.[0]?.id;e&&(u=e)}catch(e){y.warn(`Failed to resolve fallback model for provider`,{provider:t,err:e})}try{this.deps.saveAccount(t,n.trim(),r?.trim()||void 0,i?.trim()||void 0,o?.trim()||void 0),u&&this.deps.setSelectedModel(x(t,u))}catch(e){y.warn(`saveAccount failed`,e),this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`Failed to save credentials locally.`}),this.stage=`awaiting-connect`;return}try{this.deps.onAccountsChanged?.()}catch(e){y.warn(`onAccountsChanged threw`,e)}let d=l.kind===`skipped`?`Saved — ${l.reason}`:`Validated against the provider. Ready when you are.`;this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!0,kind:l.kind,note:d});let f=u&&this.deps.resolveModelLabel?.(t,u)?this.deps.resolveModelLabel?.(t,u):u||null;this.stage=`complete`,this.deps.fireFinalLick({action:`onboarding-complete-with-provider`,data:{profile:this.profile,provider:t,model:u??null,modelLabel:f,validation:l.kind}})}async handleOAuthAttempt(e){if(this.stage===`complete`)return;if(!this.deps.launchOAuth){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:`OAuth login is not available in this runtime.`});return}this.stage=`connecting`;let t;try{t=await this.deps.launchOAuth(e.provider,e.baseUrl??null)}catch(e){y.warn(`launchOAuth threw`,e),this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:e instanceof Error?e.message:`Login was cancelled.`}),this.stage=`awaiting-connect`;return}if(!t.ok){this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!1,kind:`failed`,message:t.message||`Login was cancelled.`}),this.stage=`awaiting-connect`;return}if(t.model)try{this.deps.setSelectedModel(x(e.provider,t.model))}catch(e){y.warn(`setSelectedModel after OAuth failed`,e)}try{this.deps.onAccountsChanged?.()}catch(e){y.warn(`onAccountsChanged threw`,e)}this.deps.broadcastToDip({type:`slicc-connect-result`,ok:!0,kind:`ok`,note:t.message||`Logged in.`});let n=t.model&&this.deps.resolveModelLabel?.(e.provider,t.model)?this.deps.resolveModelLabel?.(e.provider,t.model):t.model??null;this.stage=`complete`,this.deps.fireFinalLick({action:`onboarding-complete-with-provider`,data:{profile:this.profile,provider:e.provider,model:t.model??null,modelLabel:n,validation:`oauth`}})}validateProviderRequiredFields(e,t,n){let r;try{r=this.deps.getProviderCatalogue().providers.find(t=>t.id===e)}catch(e){return y.warn(`getProviderCatalogue threw during required-field gate`,e),`Could not load provider requirements. Please try again.`}return r?.requiresDeployment&&!n?.trim()?`${r.name} requires a deployment name.`:r?.requiresBaseUrl&&!t?.trim()?`${r.name} requires a base URL.`:null}async persistProfile(e){let n=t(e.name||`user`,{fallback:`user`});await this.deps.fs.writeFile(`/home/${n}/.welcome.json`,JSON.stringify(e,null,2))}};function x(e,t){return t.startsWith(`${e}:`)?t:`${e}:${t}`}export{b as OnboardingOrchestrator};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,r as t}from"./account-store-
|
|
1
|
+
import{_ as e,r as t}from"./account-store-BGptY10e.js";import{a as n}from"./diagnostics-Cag7MsZI.js";import{a as r}from"./compat-nGhSz-U1.js";import{n as i,o as a}from"./legacy-api-aliases--xyLjPgC.js";import{n as o}from"./pi-transcript-context-4pjVPiVC.js";import"./provider-settings-D8mMRRmg.js";import{n as s,r as c}from"./bridge-token-required-BYgoMwr7.js";import{n as l,r as u,t as d}from"./pkce-hGf_TEnP.js";const f=`openai-codex`,p=`app_EMoamEEZ73f0CkXaXp7hrann`,m=`https://auth.openai.com/oauth/token`,h=`http://localhost:1455/auth/callback`,g=`https://chatgpt.com/backend-api`,_=`openai-codex-responses`,v=`${f}-openai`,y={xhigh:`xhigh`,minimal:`low`},b=[{id:`gpt-5.5`,name:`GPT-5.5`,input:[`text`,`image`]},{id:`gpt-5.4`,name:`GPT-5.4`,input:[`text`,`image`]},{id:`gpt-5.4-mini`,name:`GPT-5.4 mini`,input:[`text`,`image`]},{id:`gpt-5.3-codex`,name:`GPT-5.3 Codex`,input:[`text`,`image`]},{id:`gpt-5.3-codex-spark`,name:`GPT-5.3 Codex Spark`,input:[`text`]},{id:`gpt-5.2`,name:`GPT-5.2`,input:[`text`,`image`]}].map(e=>({...e,api:`openai`,reasoning:!0,context_window:272e3,max_tokens:128e3,thinkingLevelMap:y}));async function x(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,client_id:p,code:e,code_verifier:t,redirect_uri:h}),r=await fetch(m,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw Error(`OpenAI Codex token exchange failed: ${r.status} ${await r.text()}`);let i=await r.json();if(!i.access_token)throw Error(`OpenAI Codex token exchange did not return access_token.`);return i}async function S(e){if(s())return null;try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:p}),n=await fetch(m,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});if(!n.ok){let e=await n.text();return c(n.status,e)||console.error(`[openai-codex] refresh failed:`,n.status,e),null}return await n.json()}catch(e){return console.error(`[openai-codex] refresh error:`,e instanceof Error?e.message:String(e)),null}}function C(e){try{let t=e.split(`.`);if(t.length!==3)return;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);return n.length%4&&(n+=`=`.repeat(4-n.length%4)),JSON.parse(atob(n))}catch{return}}function w(e){let t=C(e)?.[`https://api.openai.com/profile`]?.email;return typeof t==`string`?t:void 0}function T(e){let t=C(e)?.[`https://api.openai.com/auth`],n=w(e),r=typeof t?.chatgpt_plan_type==`string`?t.chatgpt_plan_type:void 0,i=r?r.charAt(0).toUpperCase()+r.slice(1):void 0;if(n&&i)return`${n} (${i})`;if(n)return n;if(i)return`ChatGPT ${i}`}async function E(e){let t=w(e);if(t)try{let e=t.trim().toLowerCase(),n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e)));return`https://www.gravatar.com/avatar/${Array.from(n).map(e=>e.toString(16).padStart(2,`0`)).join(``)}?s=128&d=404`}catch{return}}function D(){return t().find(e=>e.providerId===f)}async function O(){let t=D();if(!t?.accessToken)throw Error("Not signed in to OpenAI Codex — run `oauth-token openai-codex` or /login");let n=t.tokenExpiresAt??0;if(n&&Date.now()+6e4<n)return t.accessToken;if(t.refreshToken){let n=await S(t.refreshToken);if(n?.access_token)return await e({providerId:f,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??3600)*1e3,baseUrl:g,userName:T(n.access_token),userAvatar:await E(n.access_token),scopes:n.scope??t.scopes}),n.access_token}return t.accessToken}function k(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:v,provider:f,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function A(e){console.error(`[openai-codex] Stream error:`,e instanceof Error?e.message:String(e))}async function j(e,t,n,r){try{let a=await O(),s={...t,baseUrl:g,api:_},c=i(s,o(n),{...r,apiKey:a,transport:`sse`});for await(let t of c)e.push(t);e.end()}catch(n){A(n),e.push(k(t,n)),e.end()}}async function M(e,t,n,r){try{let i=await O(),s={...t,baseUrl:g,api:_},c=a(s,o(n),{...r,apiKey:i,transport:`sse`});for await(let t of c)e.push(t);e.end()}catch(n){A(n),e.push(k(t,n)),e.end()}}const N=(e,t,r={})=>{let i=n();return j(i,e,t,r).catch(A),i},P=(e,t,r)=>{let i=n();return M(i,e,t,r).catch(A),i},F={id:f,name:`OpenAI Codex (ChatGPT Subscription)`,description:`GPT-5 Codex via your ChatGPT Plus/Pro/Business subscription — OAuth login, no API key needed. Default model is GPT-5.5.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:`gpt-5.5`,oauthTokenDomains:[`chatgpt.com`,`*.chatgpt.com`,`auth.openai.com`,`api.openai.com`],getModelIds:()=>b,onOAuthLoginIntercepted:async(t,n,r)=>{let i=l(),a=await d(i),o=u(),s=new URL(`https://auth.openai.com/oauth/authorize`);s.searchParams.set(`response_type`,`code`),s.searchParams.set(`client_id`,p),s.searchParams.set(`redirect_uri`,h),s.searchParams.set(`scope`,r?.scopes??`openid profile email offline_access`),s.searchParams.set(`code_challenge`,a),s.searchParams.set(`code_challenge_method`,`S256`),s.searchParams.set(`state`,o),s.searchParams.set(`id_token_add_organizations`,`true`),s.searchParams.set(`codex_cli_simplified_flow`,`true`),s.searchParams.set(`originator`,`pi`);let c=await t({authorizeUrl:s.toString(),redirectUriPattern:`http://localhost:1455/auth/callback*`,onCapture:`close`});if(!c)throw Error(`OpenAI Codex OAuth login was cancelled or timed out`);let m=new URL(c),_=m.searchParams.get(`code`),v=m.searchParams.get(`state`);if(!_)throw Error(`OpenAI Codex OAuth redirect did not include a code`);if(v!==o)throw Error(`OpenAI Codex OAuth state mismatch — possible CSRF, aborting`);let y=await x(_,i);await e({providerId:f,accessToken:y.access_token,refreshToken:y.refresh_token,tokenExpiresAt:Date.now()+(y.expires_in??3600)*1e3,baseUrl:g,userName:T(y.access_token),userAvatar:await E(y.access_token),scopes:y.scope}),n()},onOAuthLogout:async()=>{await e({providerId:f,accessToken:``})},onSilentRenew:async()=>{let t=D();if(!t?.refreshToken)return null;let n=await S(t.refreshToken);return n?.access_token?(await e({providerId:f,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??3600)*1e3,baseUrl:g,userName:T(n.access_token),userAvatar:await E(n.access_token),scopes:n.scope??t.scopes}),n.access_token):null}};function I(){r({api:v,stream:N,streamSimple:P})}export{F as config,I as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./diagnostics-Cag7MsZI.js";import{a as t}from"./compat-BAGLwgqY.js";import{n,o as r}from"./legacy-api-aliases-BjgG1CsY.js";import{
|
|
1
|
+
import{a as e}from"./diagnostics-Cag7MsZI.js";import{a as t}from"./compat-BAGLwgqY.js";import{n,o as r}from"./legacy-api-aliases-BjgG1CsY.js";import{W as i,u as a}from"./account-store-DiRMol3Q.js";import"./main-Bu5EcQ93.js";import{n as o}from"./pi-transcript-context-miZCMig3.js";import{n as s,r as c}from"./bridge-token-required-DMk2va9k.js";import{n as l,r as u,t as d}from"./pkce-hGf_TEnP.js";var f=`openai-codex`,p=`app_EMoamEEZ73f0CkXaXp7hrann`,m=`https://auth.openai.com/oauth/authorize`,h=`https://auth.openai.com/oauth/token`,g=`openid profile email offline_access`,_=`http://localhost:1455/auth/callback`,v=`http://localhost:1455/auth/callback*`,y=`https://chatgpt.com/backend-api`,b=`openai-codex-responses`,x=`${f}-openai`,S={xhigh:`xhigh`,minimal:`low`},C=[{id:`gpt-5.5`,name:`GPT-5.5`,input:[`text`,`image`]},{id:`gpt-5.4`,name:`GPT-5.4`,input:[`text`,`image`]},{id:`gpt-5.4-mini`,name:`GPT-5.4 mini`,input:[`text`,`image`]},{id:`gpt-5.3-codex`,name:`GPT-5.3 Codex`,input:[`text`,`image`]},{id:`gpt-5.3-codex-spark`,name:`GPT-5.3 Codex Spark`,input:[`text`]},{id:`gpt-5.2`,name:`GPT-5.2`,input:[`text`,`image`]}].map(e=>({...e,api:`openai`,reasoning:!0,context_window:272e3,max_tokens:128e3,thinkingLevelMap:S}));async function w(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,client_id:p,code:e,code_verifier:t,redirect_uri:_}),r=await fetch(h,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw Error(`OpenAI Codex token exchange failed: ${r.status} ${await r.text()}`);let i=await r.json();if(!i.access_token)throw Error(`OpenAI Codex token exchange did not return access_token.`);return i}async function T(e){if(s())return null;try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:p}),n=await fetch(h,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});if(!n.ok){let e=await n.text();return c(n.status,e)||console.error(`[openai-codex] refresh failed:`,n.status,e),null}return await n.json()}catch(e){return console.error(`[openai-codex] refresh error:`,e instanceof Error?e.message:String(e)),null}}function E(e){try{let t=e.split(`.`);if(t.length!==3)return;let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`);return n.length%4&&(n+=`=`.repeat(4-n.length%4)),JSON.parse(atob(n))}catch{return}}function D(e){let t=E(e)?.[`https://api.openai.com/profile`]?.email;return typeof t==`string`?t:void 0}function O(e){let t=E(e)?.[`https://api.openai.com/auth`],n=D(e),r=typeof t?.chatgpt_plan_type==`string`?t.chatgpt_plan_type:void 0,i=r?r.charAt(0).toUpperCase()+r.slice(1):void 0;if(n&&i)return`${n} (${i})`;if(n)return n;if(i)return`ChatGPT ${i}`}async function k(e){let t=D(e);if(t)try{let e=t.trim().toLowerCase(),n=new Uint8Array(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e)));return`https://www.gravatar.com/avatar/${Array.from(n).map(e=>e.toString(16).padStart(2,`0`)).join(``)}?s=128&d=404`}catch{return}}function A(){return a().find(e=>e.providerId===f)}async function j(){let e=A();if(!e?.accessToken)throw Error("Not signed in to OpenAI Codex — run `oauth-token openai-codex` or /login");let t=e.tokenExpiresAt??0;if(t&&Date.now()+6e4<t)return e.accessToken;if(e.refreshToken){let t=await T(e.refreshToken);if(t?.access_token)return await i({providerId:f,accessToken:t.access_token,refreshToken:t.refresh_token??e.refreshToken,tokenExpiresAt:Date.now()+(t.expires_in??3600)*1e3,baseUrl:y,userName:O(t.access_token),userAvatar:await k(t.access_token),scopes:t.scope??e.scopes}),t.access_token}return e.accessToken}function M(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:x,provider:f,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function N(e){console.error(`[openai-codex] Stream error:`,e instanceof Error?e.message:String(e))}async function P(e,t,r,i){try{let a=await j(),s={...t,baseUrl:y,api:b},c=n(s,o(r),{...i,apiKey:a,transport:`sse`});for await(let t of c)e.push(t);e.end()}catch(n){N(n),e.push(M(t,n)),e.end()}}async function F(e,t,n,i){try{let a=await j(),s={...t,baseUrl:y,api:b},c=r(s,o(n),{...i,apiKey:a,transport:`sse`});for await(let t of c)e.push(t);e.end()}catch(n){N(n),e.push(M(t,n)),e.end()}}var I=(t,n,r={})=>{let i=e();return P(i,t,n,r).catch(N),i},L=(t,n,r)=>{let i=e();return F(i,t,n,r).catch(N),i},R={id:f,name:`OpenAI Codex (ChatGPT Subscription)`,description:`GPT-5 Codex via your ChatGPT Plus/Pro/Business subscription — OAuth login, no API key needed. Default model is GPT-5.5.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:`gpt-5.5`,oauthTokenDomains:[`chatgpt.com`,`*.chatgpt.com`,`auth.openai.com`,`api.openai.com`],getModelIds:()=>C,onOAuthLoginIntercepted:async(e,t,n)=>{let r=l(),a=await d(r),o=u(),s=new URL(m);s.searchParams.set(`response_type`,`code`),s.searchParams.set(`client_id`,p),s.searchParams.set(`redirect_uri`,_),s.searchParams.set(`scope`,n?.scopes??g),s.searchParams.set(`code_challenge`,a),s.searchParams.set(`code_challenge_method`,`S256`),s.searchParams.set(`state`,o),s.searchParams.set(`id_token_add_organizations`,`true`),s.searchParams.set(`codex_cli_simplified_flow`,`true`),s.searchParams.set(`originator`,`pi`);let c=await e({authorizeUrl:s.toString(),redirectUriPattern:v,onCapture:`close`});if(!c)throw Error(`OpenAI Codex OAuth login was cancelled or timed out`);let h=new URL(c),b=h.searchParams.get(`code`),x=h.searchParams.get(`state`);if(!b)throw Error(`OpenAI Codex OAuth redirect did not include a code`);if(x!==o)throw Error(`OpenAI Codex OAuth state mismatch — possible CSRF, aborting`);let S=await w(b,r);await i({providerId:f,accessToken:S.access_token,refreshToken:S.refresh_token,tokenExpiresAt:Date.now()+(S.expires_in??3600)*1e3,baseUrl:y,userName:O(S.access_token),userAvatar:await k(S.access_token),scopes:S.scope}),t()},onOAuthLogout:async()=>{await i({providerId:f,accessToken:``})},onSilentRenew:async()=>{let e=A();if(!e?.refreshToken)return null;let t=await T(e.refreshToken);return t?.access_token?(await i({providerId:f,accessToken:t.access_token,refreshToken:t.refresh_token??e.refreshToken,tokenExpiresAt:Date.now()+(t.expires_in??3600)*1e3,baseUrl:y,userName:O(t.access_token),userAvatar:await k(t.access_token),scopes:t.scope??e.scopes}),t.access_token):null}};function z(){t({api:x,stream:I,streamSimple:L})}export{R as config,z as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./account-store-
|
|
1
|
+
import{_ as e,a as t}from"./account-store-BGptY10e.js";import{a as n}from"./compat-nGhSz-U1.js";import{r,s as i}from"./legacy-api-aliases--xyLjPgC.js";import{n as a}from"./pi-transcript-context-4pjVPiVC.js";import"./provider-settings-D8mMRRmg.js";import{fetchModels as o,getCatalog as s}from"./openrouter-models-RwlwKz0P.js";import{loginIntercepted as c}from"./openrouter-oauth-BP-y86gf.js";const l=`openrouter`,u=`${l}-openai`,d={"HTTP-Referer":`https://sliccy.ai`,"X-Title":`SLICC`};function f(e){return{...e,baseUrl:`https://openrouter.ai/api/v1`,api:`openai-completions`}}function p(e){return{...e??{},...d}}const m=(e,n,i={})=>r(f(e),a(n),{...i,apiKey:t(l)??i.apiKey,headers:p(i.headers)}),h=(e,n,r={})=>i(f(e),a(n),{...r,apiKey:t(l)??r.apiKey,headers:p(r.headers)}),g={id:l,name:`OpenRouter`,description:`Access OpenRouter models with one-click PKCE login. No pasted API key is required.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:`anthropic/claude-sonnet-4.6`,oauthTokenDomains:[`openrouter.ai`,`*.openrouter.ai`],getModelIds:s,refreshModels:async()=>{await o()},onOAuthLoginIntercepted:async(e,t,n)=>{await c(e,()=>void 0,n),await o().catch(()=>void 0),t()},onOAuthLogout:async()=>{await e({providerId:l,accessToken:``})}};function _(){n({api:u,stream:m,streamSimple:h})}export{g as config,_ as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./compat-BAGLwgqY.js";import{r as t,s as n}from"./legacy-api-aliases-BjgG1CsY.js";import{
|
|
1
|
+
import{a as e}from"./compat-BAGLwgqY.js";import{r as t,s as n}from"./legacy-api-aliases-BjgG1CsY.js";import{W as r,h as i}from"./account-store-DiRMol3Q.js";import"./main-Bu5EcQ93.js";import{n as a}from"./pi-transcript-context-miZCMig3.js";import{fetchModels as o,getCatalog as s}from"./openrouter-models-DawLtPaY.js";import{loginIntercepted as c}from"./openrouter-oauth-BBFeemXH.js";var l=`openrouter`,u=`https://openrouter.ai/api/v1`,d=`openai-completions`,f=`${l}-openai`,p={"HTTP-Referer":`https://sliccy.ai`,"X-Title":`SLICC`};function m(e){return{...e,baseUrl:u,api:d}}function h(e){return{...e??{},...p}}var g=(e,n,r={})=>t(m(e),a(n),{...r,apiKey:i(l)??r.apiKey,headers:h(r.headers)}),_=(e,t,r={})=>n(m(e),a(t),{...r,apiKey:i(l)??r.apiKey,headers:h(r.headers)}),v={id:l,name:`OpenRouter`,description:`Access OpenRouter models with one-click PKCE login. No pasted API key is required.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:`anthropic/claude-sonnet-4.6`,oauthTokenDomains:[`openrouter.ai`,`*.openrouter.ai`],getModelIds:s,refreshModels:async()=>{await o()},onOAuthLoginIntercepted:async(e,t,n)=>{await c(e,()=>void 0,n),await o().catch(()=>void 0),t()},onOAuthLogout:async()=>{await r({providerId:l,accessToken:``})}};function y(){e({api:f,stream:g,streamSimple:_})}export{v as config,y as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./diagnostics-Cag7MsZI.js";import{a as t}from"./compat-BAGLwgqY.js";import{r as n,s as r}from"./legacy-api-aliases-BjgG1CsY.js";import{
|
|
1
|
+
import{a as e}from"./diagnostics-Cag7MsZI.js";import{a as t}from"./compat-BAGLwgqY.js";import{r as n,s as r}from"./legacy-api-aliases-BjgG1CsY.js";import{W as i,h as a}from"./account-store-DiRMol3Q.js";import"./main-Bu5EcQ93.js";import{n as o}from"./pi-transcript-context-miZCMig3.js";import{FREE_ROUTER_FALLBACK as s,fetchModels as c,getFreeCatalog as l,isModelInFreeCatalog as u}from"./openrouter-models-DawLtPaY.js";import{loginIntercepted as d}from"./openrouter-oauth-BBFeemXH.js";var f=`openrouter-free`,p=`https://openrouter.ai/api/v1`,m=`openai-completions`,h=`${f}-openai`,g={"HTTP-Referer":`https://sliccy.ai`,"X-Title":`SLICC`};function _(e){return{...e,baseUrl:p,api:m}}function v(e){return{...e??{},...g}}function y(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:h,provider:f,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function b(t){let n=e(),r=Error(`OpenRouter (Free) refused "${t.id}" — it is not in the current free catalog. Choose another free model or refresh the catalog.`);return queueMicrotask(()=>{n.push(y(t,r)),n.end()}),n}var x=(e,t,r={})=>u(e.id)?n(_(e),o(t),{...r,apiKey:a(f)??r.apiKey,headers:v(r.headers)}):b(e),S=(e,t,n={})=>u(e.id)?r(_(e),o(t),{...n,apiKey:a(f)??n.apiKey,headers:v(n.headers)}):b(e),C={id:f,name:`OpenRouter (Free)`,description:`Currently free OpenRouter models that support vision and tools. Catalog refreshes from OpenRouter; paid models are excluded.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:s.id,oauthTokenDomains:[`openrouter.ai`,`*.openrouter.ai`],getModelIds:l,refreshModels:async()=>{await c()},onOAuthLoginIntercepted:async(e,t,n)=>{await d(e,()=>void 0,{...n,providerId:f}),await c().catch(()=>void 0),t()},onOAuthLogout:async()=>{await i({providerId:f,accessToken:``})}};function w(){t({api:h,stream:x,streamSimple:S})}export{C as config,w as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t}from"./account-store-
|
|
1
|
+
import{_ as e,a as t}from"./account-store-BGptY10e.js";import{a as n}from"./diagnostics-Cag7MsZI.js";import{a as r}from"./compat-nGhSz-U1.js";import{r as i,s as a}from"./legacy-api-aliases--xyLjPgC.js";import{n as o}from"./pi-transcript-context-4pjVPiVC.js";import"./provider-settings-D8mMRRmg.js";import{FREE_ROUTER_FALLBACK as s,fetchModels as c,getFreeCatalog as l,isModelInFreeCatalog as u}from"./openrouter-models-RwlwKz0P.js";import{loginIntercepted as d}from"./openrouter-oauth-BP-y86gf.js";const f=`openrouter-free`,p=`${f}-openai`,m={"HTTP-Referer":`https://sliccy.ai`,"X-Title":`SLICC`};function h(e){return{...e,baseUrl:`https://openrouter.ai/api/v1`,api:`openai-completions`}}function g(e){return{...e??{},...m}}function _(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:p,provider:f,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function v(e){let t=n(),r=Error(`OpenRouter (Free) refused "${e.id}" — it is not in the current free catalog. Choose another free model or refresh the catalog.`);return queueMicrotask(()=>{t.push(_(e,r)),t.end()}),t}const y=(e,n,r={})=>u(e.id)?i(h(e),o(n),{...r,apiKey:t(f)??r.apiKey,headers:g(r.headers)}):v(e),b=(e,n,r={})=>u(e.id)?a(h(e),o(n),{...r,apiKey:t(f)??r.apiKey,headers:g(r.headers)}):v(e),x={id:f,name:`OpenRouter (Free)`,description:`Currently free OpenRouter models that support vision and tools. Catalog refreshes from OpenRouter; paid models are excluded.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:s.id,oauthTokenDomains:[`openrouter.ai`,`*.openrouter.ai`],getModelIds:l,refreshModels:async()=>{await c()},onOAuthLoginIntercepted:async(e,t,n)=>{await d(e,()=>void 0,{...n,providerId:f}),await c().catch(()=>void 0),t()},onOAuthLogout:async()=>{await e({providerId:f,accessToken:``})}};function S(){r({api:p,stream:y,streamSimple:b})}export{x as config,S as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{W as e}from"./account-store-DiRMol3Q.js";import"./main-Bu5EcQ93.js";import{n as t,t as n}from"./pkce-hGf_TEnP.js";var r=`https://openrouter.ai/auth`,i=`https://openrouter.ai/api/v1/auth/keys`,a=`https://openrouter.ai/api/v1`,o=`http://127.0.0.1:3000/callback`,s=`http://127.0.0.1:3000/*`;function c(e,t){let n=new URL(r);return n.searchParams.set(`callback_url`,e),n.searchParams.set(`code_challenge`,t),n.searchParams.set(`code_challenge_method`,`S256`),n.toString()}function l(e){if(!e)throw Error(`OpenRouter OAuth login was cancelled or timed out`);let t;try{t=new URL(e)}catch{throw Error(`OpenRouter OAuth returned an invalid callback URL`)}let n=t.searchParams.get(`code`);if(!n)throw Error(`OpenRouter OAuth redirect did not include an authorization code`);return n}async function u(e,t,n=fetch){let r=await n(i,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,code_verifier:t,code_challenge_method:`S256`}),signal:AbortSignal.timeout(3e4)});if(!r.ok){let e=await r.text();throw Error(`OpenRouter key exchange failed (${r.status}): ${e||`(empty response body)`}`)}let a;try{a=await r.json()}catch{throw Error(`OpenRouter key exchange returned invalid JSON`)}let o=a&&typeof a==`object`&&typeof a.key==`string`?a.key.trim():``;if(!o)throw Error(`OpenRouter key exchange returned an empty or invalid API key`);return o}async function d(r,i,d){let f=d?.providerId??`openrouter`,p=t(),m=await u(l(await r({authorizeUrl:c(o,await n(p)),redirectUriPattern:s,onCapture:`close`})),p);await e({providerId:f,accessToken:m,tokenExpiresAt:2**53-1,baseUrl:a}),i()}export{o as OPENROUTER_CALLBACK_URL,s as OPENROUTER_REDIRECT_URI_PATTERN,c as buildAuthorizeUrl,n as deriveCodeChallenge,u as exchangeCodeForKey,t as generateCodeVerifier,d as loginIntercepted,l as parseCallbackCode};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e}from"./account-store-
|
|
1
|
+
import{_ as e}from"./account-store-BGptY10e.js";import"./provider-settings-D8mMRRmg.js";import{n as t,t as n}from"./pkce-hGf_TEnP.js";const r=`http://127.0.0.1:3000/callback`,i=`http://127.0.0.1:3000/*`;function a(e,t){let n=new URL(`https://openrouter.ai/auth`);return n.searchParams.set(`callback_url`,e),n.searchParams.set(`code_challenge`,t),n.searchParams.set(`code_challenge_method`,`S256`),n.toString()}function o(e){if(!e)throw Error(`OpenRouter OAuth login was cancelled or timed out`);let t;try{t=new URL(e)}catch{throw Error(`OpenRouter OAuth returned an invalid callback URL`)}let n=t.searchParams.get(`code`);if(!n)throw Error(`OpenRouter OAuth redirect did not include an authorization code`);return n}async function s(e,t,n=fetch){let r=await n(`https://openrouter.ai/api/v1/auth/keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:e,code_verifier:t,code_challenge_method:`S256`}),signal:AbortSignal.timeout(3e4)});if(!r.ok){let e=await r.text();throw Error(`OpenRouter key exchange failed (${r.status}): ${e||`(empty response body)`}`)}let i;try{i=await r.json()}catch{throw Error(`OpenRouter key exchange returned invalid JSON`)}let a=i&&typeof i==`object`&&typeof i.key==`string`?i.key.trim():``;if(!a)throw Error(`OpenRouter key exchange returned an empty or invalid API key`);return a}async function c(c,l,u){let d=u?.providerId??`openrouter`,f=t(),p=await n(f),m=await s(o(await c({authorizeUrl:a(r,p),redirectUriPattern:i,onCapture:`close`})),f);await e({providerId:d,accessToken:m,tokenExpiresAt:2**53-1,baseUrl:`https://openrouter.ai/api/v1`}),l()}export{r as OPENROUTER_CALLBACK_URL,i as OPENROUTER_REDIRECT_URI_PATTERN,a as buildAuthorizeUrl,n as deriveCodeChallenge,s as exchangeCodeForKey,t as generateCodeVerifier,c as loginIntercepted,o as parseCallbackCode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Async as e,FileSystem as t,InMemory as n,IndexFS as r,Inode as i,Sync as a,a as o,d as s,f as c,h as l,i as u,isFile as d,m as f,n as p,o as m,p as h,r as g,resolveMountConfig as _,s as v,t as y,u as b,v as x}from"./dist-HBVgABmW.js";import{i as S,r as C}from"./fs-
|
|
1
|
+
import{Async as e,FileSystem as t,InMemory as n,IndexFS as r,Inode as i,Sync as a,a as o,d as s,f as c,h as l,i as u,isFile as d,m as f,n as p,o as m,p as h,r as g,resolveMountConfig as _,s as v,t as y,u as b,v as x}from"./dist-HBVgABmW.js";import{i as S,r as C}from"./fs-BUK-3Ws8.js";function w(e){switch(e.name){case`TypeMismatchError`:return`EPERM`;case`IndexSizeError`:case`HierarchyRequestError`:case`InvalidCharacterError`:case`InvalidStateError`:case`SyntaxError`:case`NamespaceError`:case`ConstraintError`:case`VersionError`:case`URLMismatchError`:case`InvalidNodeTypeError`:return`EINVAL`;case`WrongDocumentError`:return`EXDEV`;case`NoModificationAllowedError`:case`InvalidModificationError`:case`InvalidAccessError`:case`SecurityError`:case`NotAllowedError`:return`EACCES`;case`NotFoundError`:return`ENOENT`;case`NotSupportedError`:return`ENOTSUP`;case`InUseAttributeError`:return`EBUSY`;case`NetworkError`:return`ENETDOWN`;case`AbortError`:return`EINTR`;case`QuotaExceededError`:return`ENOSPC`;case`TimeoutError`:return`ETIMEDOUT`;case`ReadOnlyError`:return`EROFS`;default:return`EIO`}}function T(e,t){if(e instanceof f)return e;let n=e instanceof DOMException?h[w(e)]:h.EIO,r=new f(n,e.message);return r.stack=e.stack,Error.captureStackTrace?.(r,T),r.cause=e.cause,r}function E(e){return typeof e==`object`&&!!e&&e.constructor.name==`SharedArrayBuffer`}function D(e){return e instanceof ArrayBuffer?e.resizable:E(e)?e.growable:!1}function O(e,t){return e.kind==t}var k=class extends e(r){async _loadHandles(e,t){for await(let[n,r]of t.entries()){let t=u(e,n);this._handles.set(t,r),O(r,`directory`)&&await this._loadHandles(t,r)}}async _loadMetadata(e){if(this._handles.set(`/`,this.root),await this._loadHandles(`/`,this.root),e){let t=await(await(await this.get(`file`,e)).getFile()).text(),n=JSON.parse(t);this.index.fromJSON(n);return}c(`webaccessfs: no metadata file specified, generating new metadata`);for(let[e,t]of this._handles){let n=this.index._alloc();if(O(t,`file`)){let{lastModified:r,size:a}=await t.getFile();this.index.set(e,new i({mode:420|v,size:a,mtimeMs:r,ino:n,data:n+1,nlink:1}));continue}if(!O(t,`directory`))throw l(`EIO`,`Invalid handle`);this.index.set(e,new i({mode:511|o,size:0,ino:n,data:n+1,nlink:1}))}}constructor(e,t=!1){super(2003133025,`webaccessfs`),this.root=e,this.disableHandleCache=t,this._handles=new Map,this._sync=n.create({label:`accessfs-cache`}),this.attributes.set(`no_buffer_resize`,!0),t&&this.attributes.set(`no_handle_cache`,!0)}async stat(e){try{return await super.stat(e)}catch(t){if(t.code!=`ENOENT`)throw t;let n=await this.get(null,e),r=this.index._alloc(),a=new i({ino:r,data:r+1,nlink:1});if(O(n,`file`)){let e=await n.getFile();a.update({mode:420|v,size:e.size,mtimeMs:e.lastModified})}else a.update({mode:o|511,size:0});return this.index.set(e,a),a}}async touch(e,t){let n=this.index.get(e);if(!n)throw l(`ENOENT`);if(typeof t.size!=`number`||!d(n))return await super.touch(e,t);let r=await this.get(`file`,e).catch(e=>{if(e.code!=`ENOENT`)throw e});if(!r)return await super.touch(e,t);let{size:i}=await r.getFile();if(i==t.size)return await super.touch(e,t);let a=await r.createWritable({keepExistingData:!!t.size});try{await a.truncate(t.size)}catch{await a.write({type:`truncate`,size:t.size})}await a.close(),await super.touch(e,t)}async readdir(e){let t=await this.get(`directory`,e);return await Array.fromAsync(t.keys())}async remove(e){let t=await this.get(`directory`,g(e));for(let t of this._handles.keys())g(t)==e&&this._handles.delete(t);this._handles.delete(e),await t.removeEntry(p(e),{recursive:!0}).catch(t=>{let n=T(t,e);n.code!=`ENOENT`&&x(n)})}removeSync(){throw s(l(`ENOSYS`))}async read(e,t,n,r){if(r<=n)return;let i=await this.get(`file`,e),a=r-n,o=()=>b(l(`EIO`,[`Unexpected mismatch in file data size. This should not happen.`,`tried to read ${a} bytes at ${n}.`,`path: ${e}`].join(`
|
|
2
2
|
`+` `.repeat(24))));if(typeof i.createSyncAccessHandle==`function`){let e;try{e=await i.createSyncAccessHandle();let r=t.subarray(0,a);if(e.read(r,{at:n})<a)throw o();return}catch(e){if(e&&e.code===`EIO`)throw e}finally{e?.close()}}let s=e=>e instanceof DOMException&&e.name===`NotReadableError`,c=e=>new Promise(t=>setTimeout(t,25*(e+1))),u,d=!1;for(let e=0;;e++){let t;try{t=await i.getFile()}catch(t){if(!s(t)||e>=2)throw t;await c(e);continue}try{d=typeof t.slice==`function`,u=await(d?t.slice(n,r):t).arrayBuffer();break}catch(t){if(!s(t)||e>=2)throw t;await c(e)}}if(!d&&u.byteLength<r||d&&u.byteLength<a)throw o();t.set(d?new Uint8Array(u):new Uint8Array(u,n,a))}async write(e,t,n){if(D(t.buffer)||E(t.buffer)){let e=new Uint8Array(new ArrayBuffer(t.byteLength),t.byteOffset,t.byteLength);e.set(t),t=e}let r=this.index.get(e);if(!r)throw l(`ENOENT`);let i=(r.mode&m)==o,a;try{a=await this.get(i?`directory`:`file`,e)}catch{a=await(await this.get(`directory`,g(e)))[i?`getDirectoryHandle`:`getFileHandle`](p(e),{create:!0}).catch(t=>x(T(t,e))),this.disableHandleCache||this._handles.set(e,a)}if(i)return;if(O(a,`directory`)){s(l(`EIO`,`Mismatch in entry kind on write`));return}if(typeof a.createSyncAccessHandle==`function`){let i;try{i=await a.createSyncAccessHandle()}catch{i=void 0}if(i){try{let r=i.write(t,{at:n||0});if(r<t.byteLength)throw l(`EIO`,`short write: ${r} of ${t.byteLength} bytes at ${n||0} to ${e}`);i.flush()}finally{i.close()}let{size:o,lastModified:s}=await a.getFile();r.update({size:o,mtimeMs:s}),this.index.set(e,r);return}}let c=await a.createWritable({keepExistingData:!0});if(n)try{await c.seek(n)}catch{await c.write({type:`seek`,position:n})}await c.write(t),await c.close();let{size:u,lastModified:d}=await a.getFile();r.update({size:u,mtimeMs:d}),this.index.set(e,r)}async writeFile(e,t){return this.write(e,t,0)}async _create(e,t){let n=await(await this.get(`directory`,g(e))).getFileHandle(p(e),{create:!0}).catch(t=>x(T(t,e)));this.disableHandleCache||this._handles.set(e,n)}async _mkdir(e){let t=await(await this.get(`directory`,g(e))).getDirectoryHandle(p(e),{create:!0}).catch(t=>x(T(t,e)));this.disableHandleCache||this._handles.set(e,t)}async get(e=null,t){let n=this._handles.get(t);if(!this.disableHandleCache&&n){if(e&&!O(n,e))throw l(e==`directory`?`ENOTDIR`:`EISDIR`);return n}if(t==`/`)return this.root;let r=t.slice(1).split(`/`),i=this.root;for(let e=0;e<r.length-1;++e)i=await i.getDirectoryHandle(r[e]).catch(e=>x(e.name==`TypeMismatchError`?l(`ENOTDIR`):T(e,t)));try{let n=await i[e==`file`?`getFileHandle`:`getDirectoryHandle`](r.at(-1));return this.disableHandleCache||this._handles.set(t,n),n}catch(n){if(n.name!=`TypeMismatchError`)throw T(n,t);if(e===null){let e=await i.getFileHandle(r.at(-1)).catch(e=>x(T(e,t)));return this.disableHandleCache||this._handles.set(t,e),e}throw l(e==`file`?`EISDIR`:`ENOTDIR`)}}},A={name:`WebAccess`,options:{handle:{type:`object`,required:!0},metadata:{type:`string`,required:!1},disableHandleCache:{type:`boolean`,required:!1},maxOpenFilesForCopy:{type:`number`,required:!1}},async create(e){let t=new k(e.handle,e.disableHandleCache);return t._crossCopySemaphore=new y(e.maxOpenFilesForCopy??128),await t._loadMetadata(e.metadata),t}};a(t);var j=16;async function M({handle:e,dbName:t,asyncCache:n,onRepairProgress:r,withWriteLock:i}){let a=()=>i(()=>C(e,r));try{let e=await a();e?.changed&&console.warn(`[virtual-fs] repaired metadata sidecar before mount (#2146)`,{dbName:t,kindFixed:e.kindFixed,sizesFixed:e.sizesFixed,dropped:e.dropped,inosReassigned:e.inosReassigned,nlinksFixed:e.nlinksFixed,selfEntryDropped:e.selfEntryDropped})}catch{}return S(()=>_({backend:A,handle:e,metadata:`/.metadata.json`,maxOpenFilesForCopy:j,disableAsyncCache:n===!1}),a,e=>console.warn(`[virtual-fs] repaired poisoned metadata sidecar; retrying mount`,{dbName:t,kindFixed:e.kindFixed,sizesFixed:e.sizesFixed,dropped:e.dropped,nlinksFixed:e.nlinksFixed,selfEntryDropped:e.selfEntryDropped}))}export{M as resolveOpfsMount};
|
package/dist/ui/assets/{page-approval-service-BbEv1dSc.js → page-approval-service-ja6kjLj8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./float-topology-
|
|
1
|
+
import{t as e}from"./logger-DDBAeTLF.js";import{t}from"./float-topology-C_iRKPQK.js";import{n}from"./types-DSxCdZw6.js";var r=e(`sudo-panel`),i=typeof globalThis.confirm==`function`?globalThis.confirm.bind(globalThis):void 0,a=typeof globalThis.prompt==`function`?globalThis.prompt.bind(globalThis):void 0;function o(){return globalThis.document?.visibilityState===`hidden`}function s(e,t={}){let s=t.confirm??i,c=t.prompt??a;if(!s)return r.warn(`no native confirm available in this realm — denying`),n();let l=t.isHidden??o,u=e.requester?`Requested by: ${e.requester}\n\n`:``,d=e.reason?`\n\nReason given: ${e.reason}`:``,f=`Approve ${e.kind}:\n\n${u}${e.detail}${d}\n\nOK = allow · Cancel = deny`,p=l();if(!s(f))return p||l()?(r.warn(`native confirm returned false in a hidden document — unavailable, not refused`),n()):{decision:`deny`};let m=e.suggestedPattern?.trim()||e.detail.trim();if(!s(`Always allow actions matching:\n\n${m}\n\nOK = always · Cancel = just this once`))return{decision:`allow`};let h=c?.(`Edit the "Always" allow pattern:`,m);return{decision:`always`,pattern:h&&h.trim().length>0?h.trim():m}}function c(e={}){let t=globalThis.chrome?.runtime?.onMessage;return!t||typeof t.addListener!=`function`?!1:(t.addListener((t,i,a)=>{if(!l(t))return;let o=t.payload.request;try{a({ok:!0,decision:s(o,e)})}catch(e){r.warn(`panel responder threw — denying`,{error:e instanceof Error?e.message:String(e)}),a({ok:!1,decision:n(),error:`panel responder error`})}return!1}),!0)}function l(e){if(!e||typeof e!=`object`)return!1;let t=e;if(t.source!==`offscreen`)return!1;let n=t.payload;if(!n||n.type!==`sudo-request`)return!1;let r=n.request;return!!r&&typeof r.kind==`string`&&typeof r.detail==`string`}var u=e(`sudo:page`),d=null;function f(e){d=e}async function p(e){let t=d;if(!t)return null;let r=!1;try{r=t.shouldDelegate()}catch(e){u.warn(`tray delegate probe threw — treating as not delegable`,{error:e instanceof Error?e.message:String(e)})}if(!r)return null;try{return{decision:await t.requestApproval(e),handled:!0}}catch(e){return u.warn(`tray-delegated sudo approval threw — denying`,{error:e instanceof Error?e.message:String(e)}),{decision:n(),handled:!0}}}async function m(e,t){try{return{decision:t(e),handled:!0}}catch(e){return u.warn(`in-page sudo prompt threw — denying`,{error:e instanceof Error?e.message:String(e)}),{decision:n(),handled:!0}}}async function h(e,n=`resolve`,r={}){let i=await p(e);if(i)return i;let a=r.hasLocalNodeServer??t;return n===`tray-first`&&a()?{decision:{decision:`deny`},handled:!1}:m(e,r.nativeResolve??s)}export{s as n,h as resolveSudoApprovalInPage,f as setSudoTrayDelegate,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./panel-rpc-accessor-B4BfPLSo.js";var n=e({COMPUTER_NATIVE_FRAME_CHANNEL:()=>s,PANEL_RPC_DEFAULT_TIMEOUT_MS:()=>a,createPanelRpcClient:()=>c,getPanelRpcClient:()=>t,panelRpcChannelName:()=>o});const r=`slicc-panel-rpc`,i=15e3,a=i;function o(e){return e?`${r}:${e}`:r}const s=`computer-native-frame`;function c(e={}){if(typeof BroadcastChannel!=`function`)return{call:()=>Promise.reject(Error(`panel-rpc: BroadcastChannel is unavailable`)),onEvent:()=>()=>{},registerPushTarget:()=>{},unregisterPushTarget:()=>{},dispose:()=>{}};let t=o(e.instanceId),n=new BroadcastChannel(t),r=new Map,a=new Map,s=new Map,c=e=>{let t=s.get(e.channel);if(t)for(let n of t)try{n(e.payload)}catch(t){console.warn(`panel-rpc: event handler for '${e.channel}' threw:`,t instanceof Error?t.message:String(t))}},u=e=>{if(e.op!==`remote-cdp-event`)return;let t=e.payload;a.get(`${t.runtimeId}:${t.localTargetId}`)?.(t)},d=e=>{let t=r.get(e.id);t&&(r.delete(e.id),clearTimeout(t.timer),typeof e.error==`string`?t.reject(Error(e.error)):t.resolve(e.result))};n.addEventListener(`message`,e=>{let t=e.data;t?.type===`panel-rpc-event`?c(t):t?.type===`panel-rpc-push`?u(t):t?.type===`panel-rpc-response`&&d(t)});function f(e,t){let n=s.get(e);return n||(n=new Set,s.set(e,n)),n.add(t),()=>{let n=s.get(e);n&&(n.delete(t),n.size===0&&s.delete(e))}}function p(e,t,a={}){let o=l(),s=a.timeoutMs??i,c=a.signal;return c?.aborted?Promise.reject(new DOMException(`The operation was aborted.`,`AbortError`)):new Promise((i,a)=>{let l=setTimeout(()=>{r.delete(o),c?.removeEventListener(`abort`,u),a(Error(`panel-rpc: op '${e}' timed out after ${s}ms`))},s),u=()=>{let e=r.get(o);e&&(r.delete(o),clearTimeout(e.timer),a(new DOMException(`The operation was aborted.`,`AbortError`)))};c?.addEventListener(`abort`,u,{once:!0}),r.set(o,{resolve:e=>{c?.removeEventListener(`abort`,u),i(e)},reject:a,timer:l});let d={type:`panel-rpc-request`,id:o,op:e,payload:t};n.postMessage(d)})}function m(e,t){a.set(e,t)}function h(e){a.delete(e)}function g(){for(let[,e]of r)clearTimeout(e.timer),e.reject(Error(`panel-rpc: client disposed`));r.clear(),s.clear(),a.clear();try{n.close()}catch{}}return{call:p,onEvent:f,registerPushTarget:m,unregisterPushTarget:h,dispose:g}}function l(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?`prpc-${crypto.randomUUID()}`:`prpc-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`}export{a as n,n as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return globalThis.__slicc_panelRpc??null}function t(){return typeof window<`u`&&typeof document<`u`}export{t as n,e as t};
|