sliccy 6.167.0 → 6.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/node-server/_shared/computer-protocol.d.ts +2 -0
- package/dist/node-server/_shared/computer-protocol.d.ts.map +1 -1
- package/dist/node-server/computer-demo.d.ts +36 -0
- package/dist/node-server/computer-demo.js +126 -0
- package/dist/node-server/index.js +13 -3
- package/dist/node-server/runtime-flags.d.ts +2 -0
- package/dist/node-server/runtime-flags.js +5 -0
- package/dist/ui/.vite/manifest.json +260 -251
- package/dist/ui/assets/SKILL-CQxpe2fi.js +1 -0
- package/dist/ui/assets/{account-store-B05_LKnj.js → account-store-jjUZwcjI.js} +1 -1
- package/dist/ui/assets/{account-store-CNTI4kr_.js → account-store-pXgYgQVx.js} +2 -2
- package/dist/ui/assets/{adobe-nu3irXcy.js → adobe-C42_geSB.js} +1 -1
- package/dist/ui/assets/{adobe-CRRWEbtf.js → adobe-CKCos4Yf.js} +2 -2
- package/dist/ui/assets/{agent-panels-DvH_qfTh.js → agent-panels-C34MxFav.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-BA5r_r61.js → almost-bash-shell-headless-B5YFQ1wh.js} +521 -548
- package/dist/ui/assets/{apply-layout-CASSSWEy.js → apply-layout-D2V9rxZu.js} +1 -1
- package/dist/ui/assets/approval-timeout-BQ29Z0gf.js +1 -0
- package/dist/ui/assets/{apps-BGe9_zJ7.js → apps-CVkFAyGJ.js} +1 -1
- package/dist/ui/assets/{azure-openai-C-Iw82HZ.js → azure-openai-DucxGbzT.js} +1 -1
- package/dist/ui/assets/{azure-openai-DuJciOKd.js → azure-openai-yAg-vpgC.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-DdAVlPMP.js → backend-hostfs-Ls-A2H2N.js} +1 -1
- package/dist/ui/assets/browser-DuyhpHbR.js +1 -0
- package/dist/ui/assets/{capability-C2eJ1wdx.js → capability-SIitRcq_.js} +2 -2
- package/dist/ui/assets/{cdp-DG8TVjf3.js → cdp-DDYzhKE6.js} +1 -1
- package/dist/ui/assets/{cerebras-BXwtUxTj.js → cerebras-CNR3k849.js} +1 -1
- package/dist/ui/assets/{cerebras-Xadzrxfp.js → cerebras-_--8Umtj.js} +1 -1
- package/dist/ui/assets/{client-BDN4zG90.js → client-_vVqanZy.js} +1 -1
- package/dist/ui/assets/{composer-speech-_uq5e0Bo.js → composer-speech-D8IeaPdq.js} +1 -1
- package/dist/ui/assets/{connect-surface-odDz37TJ.js → connect-surface-Bnfiw-HT.js} +1 -1
- package/dist/ui/assets/{core-BoFWHLIW.js → core-eZ1aR21T.js} +1 -1
- package/dist/ui/assets/core-vzw5Cr8B.js +36 -0
- package/dist/ui/assets/{directed-approval-D_AXAvuz.js → directed-approval-CtbQZigA.js} +1 -1
- package/dist/ui/assets/{discovery-preference-TziZ7Yxu.js → discovery-preference-G3mw_EUO.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-DTj236n-.js → ensure-speech-assets-BGvEg25e.js} +1 -1
- package/dist/ui/assets/es-DJTRBqjm.js +52 -0
- package/dist/ui/assets/{extension-ops-DNPAsYbK.js → extension-ops-B2RMipFn.js} +1 -1
- package/dist/ui/assets/{float-topology-CurCyQFy.js → float-topology-CyZCUfkj.js} +1 -1
- package/dist/ui/assets/{follower-navigate-watcher-C98XMw_C.js → follower-navigate-watcher-BAstHBQ5.js} +1 -1
- package/dist/ui/assets/frames-FHlUaNCs.js +1 -0
- package/dist/ui/assets/{frozen-archive-writer-BIzZxx8R.js → frozen-archive-writer-DFE4MYD-.js} +1 -1
- package/dist/ui/assets/{fs-Bq8bUwe2.js → fs-BLqkdQnU.js} +1 -1
- package/dist/ui/assets/{fs-CJs9n90Q.js → fs-DRouAGaW.js} +2 -2
- package/dist/ui/assets/{gelatiere-store-BY0hZvSS.js → gelatiere-store-D_JKXdpV.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-DrQwRL3O.js → gelatiere-unit-Q-gB5yVf.js} +1 -1
- package/dist/ui/assets/{github-uDwUwz5H.js → github-Cfpmwf1n.js} +1 -1
- package/dist/ui/assets/{github-D1gd3q6u.js → github-DLAFwQdm.js} +2 -2
- package/dist/ui/assets/{github-auth-CzzE1eDf.js → github-auth-DnIBV6_3.js} +1 -1
- package/dist/ui/assets/{github-copilot-Bx2lXrwK.js → github-copilot-BFfPdiKK.js} +1 -1
- package/dist/ui/assets/{github-copilot-DidNEEe_.js → github-copilot-EtGePnlq.js} +1 -1
- package/dist/ui/assets/{github-install--_xp8s-S.js → github-install-1nDy7YKR.js} +1 -1
- package/dist/ui/assets/{github-zip-Bs35nBig.js → github-zip-B-FKgUOX.js} +1 -1
- package/dist/ui/assets/{guest-tool-gate-B-lZT9hl.js → guest-tool-gate-GANtsowg.js} +1 -1
- package/dist/ui/assets/{hear-BNmJphKg.js → hear-BMEHlsdb.js} +1 -1
- package/dist/ui/assets/{help-C7Nq107k.js → help-DWGffc9y.js} +1 -1
- package/dist/ui/assets/{host-iTtS0MRF.js → host-AggLcUuh.js} +1 -1
- package/dist/ui/assets/host-command-XUdketMY.js +28 -0
- package/dist/ui/assets/{installer-C0xiAs69.js → installer-BHkUBh6r.js} +1 -1
- package/dist/ui/assets/{isomorphic-git-D2fV6xS-.js → isomorphic-git-B8-ayEVu.js} +7 -7
- package/dist/ui/assets/{isomorphic-git-B7et_8Xe.js → isomorphic-git-DuHitnAl.js} +10 -10
- package/dist/ui/assets/{js-realm-worker-B9Rz0g1p.js → js-realm-worker-Zk_Jd1kr.js} +1 -1
- package/dist/ui/assets/{jsh-executor-C7QPZ2Qr.js → jsh-executor-K5sbbmbA.js} +2 -2
- package/dist/ui/assets/{kernel-worker-4aPSVJ1C.js → kernel-worker-Bq9IjFw5.js} +34 -34
- package/dist/ui/assets/lick-urls-CgPiVwD-.js +1 -0
- package/dist/ui/assets/lick-ws-bridge-8HhoCHq8.js +1 -0
- package/dist/ui/assets/{lick-ws-bridge-BcAhlead.js → lick-ws-bridge-Ra_w6naR.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-COMr2v0o.js → live-session-snapshot-lUnl-mYx.js} +1 -1
- package/dist/ui/assets/{local-llm-DdGb9WMG.js → local-llm-B80bjN-D.js} +1 -1
- package/dist/ui/assets/{local-llm-DqeU7kV3.js → local-llm-OcOXhJKt.js} +1 -1
- package/dist/ui/assets/{main-jc6OS8lz.js → main-BRoNZPBl.js} +3 -3
- package/dist/ui/assets/{main-cherry-BGZmJFd_.js → main-cherry-DD2gWq8O.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-B8pprlUo.js → memory-curation-seam-CcNJCyMJ.js} +1 -1
- package/dist/ui/assets/{memory-health-CGkpyA7o.js → memory-health-DZmKH-IW.js} +1 -1
- package/dist/ui/assets/memory-v2-flag-DK0lPu0X.js +1 -0
- package/dist/ui/assets/{memory-write-execute-B-ahXjaO.js → memory-write-execute-6yK_MOdy.js} +1 -1
- package/dist/ui/assets/{mount-BzdPNQoA.js → mount-CQBa9QoF.js} +3 -3
- package/dist/ui/assets/{mount-FkNAB0be.js → mount-Dz-lPlKf.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-BO0N4wwP.js → mount-bridge-client-BOZDQLbT.js} +1 -1
- package/dist/ui/assets/{mount-bridge-client-CRnohfom.js → mount-bridge-client-BRywSH1d.js} +1 -1
- package/dist/ui/assets/{mv-DRuZuDHt.js → mv-C7mk2zT1.js} +1 -1
- package/dist/ui/assets/{new-session-B8iOhaK0.js → new-session-CXbgg4am.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-B9PwK4-d.js → oauth-bootstrap-1lsyWJGc.js} +2 -2
- package/dist/ui/assets/{oauth-service-UTPOqIwj.js → oauth-service-CRmx6zI1.js} +1 -1
- package/dist/ui/assets/{oauth-service-Bkaz0Dt4.js → oauth-service-WTeDvR5m.js} +1 -1
- package/dist/ui/assets/{onboarding-orchestrator-Cc8Glrem.js → onboarding-orchestrator-SsjiVLB2.js} +1 -1
- package/dist/ui/assets/{openai-codex-BrQ1tsgu.js → openai-codex-BJzpp5yt.js} +1 -1
- package/dist/ui/assets/{openai-codex-DmHr_2RR.js → openai-codex-DDer9WGr.js} +1 -1
- package/dist/ui/assets/{openrouter-C6WDBJvB.js → openrouter-CdsU1YkP.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CUKlyrhq.js → openrouter-free-D1H2Ji7e.js} +1 -1
- package/dist/ui/assets/{openrouter-free-CFBzPY5J.js → openrouter-free-zplQAXSX.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DOdpRMfw.js → openrouter-oauth-Bu3uuWMP.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-RC0CxY4X.js → openrouter-oauth-CrvWvUZV.js} +1 -1
- package/dist/ui/assets/{openrouter-BvM36eS5.js → openrouter-xGsvfFPH.js} +1 -1
- package/dist/ui/assets/{opfs-mount-B78yj9gx.js → opfs-mount-BqBx391V.js} +1 -1
- package/dist/ui/assets/{page-approval-service-Dy-UA1aK.js → page-approval-service-BkqDCbBQ.js} +1 -1
- package/dist/ui/assets/panel-rpc-handlers-CXr7dAtk.js +2 -0
- package/dist/ui/assets/{panelize-shell-CFPiIneK.js → panelize-shell-DjnrzeLU.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-BDl_Xp_M.js → pi-edit-execution-Dn7wc7f8.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-ff8DctEN.js → port-bridge-client-CZFX4fUT.js} +1 -1
- package/dist/ui/assets/{port-bridge-client-H03Pohgj.js → port-bridge-client-CkkC3v5w.js} +1 -1
- package/dist/ui/assets/{provider-1ByYSphI.js → provider-BCNJf9_1.js} +2 -2
- package/dist/ui/assets/{provider-Df8LFEZ7.js → provider-DiIrGlmw.js} +1 -1
- package/dist/ui/assets/{provider-settings-Bk-fk9dp.js → provider-settings-DSf8xD9N.js} +1 -1
- package/dist/ui/assets/provider-store-access-CsczvZfg.js +1 -0
- package/dist/ui/assets/provider-store-access-et-xszx-.js +1 -0
- package/dist/ui/assets/{providers-Q92pCQ8h.js → providers-CFveri5U.js} +2 -2
- package/dist/ui/assets/{providers-T_FH_8cU.js → providers-CfE8Z8rn.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-DARKNygr.js → proxied-fetch-CPL8wJM2.js} +1 -1
- package/dist/ui/assets/{proxied-fetch-Bl8AeYdt.js → proxied-fetch-CnCvBaGV.js} +1 -1
- package/dist/ui/assets/{quick-llm-CbGHjrhX.js → quick-llm-t6CBwwSm.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-CWMnXeN3.js → realm-inprocess-CmaGqRYS.js} +1 -1
- package/dist/ui/assets/{recovery-screen-DhUqOdby.js → recovery-screen-DdKutJyi.js} +1 -1
- package/dist/ui/assets/{redirect-uri-Dd0j1fSp.js → redirect-uri-D2aDPCyB.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-D4Ah4AQY.js → remote-terminal-view-CA-SfvvZ.js} +2 -2
- package/dist/ui/assets/{rest-ops-CQOwDiTR.js → rest-ops-Yu_dXm4T.js} +1 -1
- package/dist/ui/assets/{rest-ops-DkUeDpiM.js → rest-ops-aP40ni1y.js} +1 -1
- package/dist/ui/assets/{restore-CVkulBmU.js → restore-Dk9r9feA.js} +1 -1
- package/dist/ui/assets/{run-B-t7kWH3.js → run-BEs473Sp.js} +1 -1
- package/dist/ui/assets/run-CHjRjdbt.js +75 -0
- package/dist/ui/assets/{run-DgVV_DFr.js → run-CNldrNje.js} +3 -3
- package/dist/ui/assets/{run-ZmpHaamT.js → run-CyYVrNXy.js} +2 -2
- package/dist/ui/assets/{run-BX9uHbIi.js → run-D5s_jfOL.js} +1 -1
- package/dist/ui/assets/{run-COfTem8j.js → run-QfYlwe2c.js} +1 -1
- package/dist/ui/assets/{run-IexPmM2B.js → run-V-RPlN7V.js} +2 -2
- package/dist/ui/assets/{run-CUCg2cJM.js → run-wxYu-gUG.js} +2 -2
- package/dist/ui/assets/screen-s6LdF1JP.js +1 -0
- package/dist/ui/assets/screen-share-approval-live-D388fVD9.js +1 -0
- package/dist/ui/assets/screencapture-media-BjmoKpyn.js +1 -0
- package/dist/ui/assets/screencapture-media-CM5E2g6c.js +1 -0
- package/dist/ui/assets/screencapture-media-shared-DlK1Wqh8.js +1 -0
- package/dist/ui/assets/{screencapture-run-yMA5c_HS.js → screencapture-run-zmx5QKf_.js} +2 -2
- package/dist/ui/assets/{secret-env-BhWGz7yx.js → secret-env-DgrZZVFU.js} +1 -1
- package/dist/ui/assets/secret-topology-BrobAGSV.js +1 -0
- package/dist/ui/assets/{secrets-bridge-client-C0tvQeuX.js → secrets-bridge-client-BJqZCK6Q.js} +1 -1
- package/dist/ui/assets/{secrets-bridge-client-BS3V1JBF.js → secrets-bridge-client-CeK7HpDf.js} +1 -1
- package/dist/ui/assets/{session-command-memory-DzuRy-nC.js → session-command-memory-x5HxxZtb.js} +2 -2
- package/dist/ui/assets/{session-jsonl-iOOR_32X.js → session-jsonl-3Y2sXuNG.js} +1 -1
- package/dist/ui/assets/{session-jsonl-D01HYAS2.js → session-jsonl-DI8wVUpH.js} +1 -1
- package/dist/ui/assets/{session-search-index-CABvtt-r.js → session-search-index-DRFKeHXl.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-CvstKwBW.js → setup-feature-flags-remote-CEtNYgED.js} +1 -1
- package/dist/ui/assets/{signed-fetch-7NwdVmf1.js → signed-fetch-E-2q08XL.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-CXHqSiPb.js → silent-renew-backoff-Ddlf2gAw.js} +1 -1
- package/dist/ui/assets/slicc-version-bYxfYms3.js +1 -0
- package/dist/ui/assets/{snapshot-BcYaw9Ip.js → snapshot-Dv7-7kFE.js} +1 -1
- package/dist/ui/assets/{snapshot-features-3xslkGtL.js → snapshot-features-rlYmVQ8i.js} +1 -1
- package/dist/ui/assets/{soundscape-TygolFwj.js → soundscape-CyBhtUGQ.js} +1 -1
- package/dist/ui/assets/{speak-BCLm04Z2.js → speak-qRc1po5e.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-DDzNanda.js → sprinkle-manager-DT2AYalc.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-B-CADNjq.js → sprinkle-renderer-DF4JYgsw.js} +1 -1
- package/dist/ui/assets/ssh-BQqlQVXQ.js +6 -0
- package/dist/ui/assets/{state-BCTAzK_L.js → state-RVr0GidF.js} +1 -1
- package/dist/ui/assets/{store-C-AW4ogv.js → store-BlFQl8dG.js} +1 -1
- package/dist/ui/assets/{store-CzlK9KIc.js → store-CYwEydJ4.js} +1 -1
- package/dist/ui/assets/{sudo-BtkDnUA_.js → sudo-BqpeZUOO.js} +1 -1
- package/dist/ui/assets/sudo-fs-C6r_MIIY.js +3 -0
- package/dist/ui/assets/{supervisor-B6-QPxI3.js → supervisor-C1sPrIbH.js} +1 -1
- package/dist/ui/assets/{sync-dialog-B4G7kCwj.js → sync-dialog-sC277gbg.js} +1 -1
- package/dist/ui/assets/tool-ui-DRnUkp2g.js +1 -0
- package/dist/ui/assets/{transformers-env-1TbBNkOp.js → transformers-env-BzsQpYgD.js} +1 -1
- package/dist/ui/assets/{tray-leader-_KISvFyF.js → tray-leader-Gx_yzXFX.js} +1 -1
- package/dist/ui/assets/{lick-urls-DdKPDlgq.js → tray-leader-status-CpkFr6n7.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-CRsRkPHc.js → tray-leave-runtime-Cuj-CStD.js} +1 -1
- package/dist/ui/assets/{tray-runtime-config-BVgVR3H2.js → tray-runtime-config-dyxCfUex.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-BRvCb-i7.js → tray-sidecar-BCAds1ts.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-C5daiUbn.js → upgrade-detection-CXNgKpwK.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-C2ZQ0c2-.js → upskill-lick-skip-wDM3Vdyq.js} +1 -1
- package/dist/ui/assets/url-Dq7PTmNp.js +1 -0
- package/dist/ui/assets/v86-Cv7l0TeZ.js +1 -0
- package/dist/ui/assets/{voice-reply-Dk4ztuZL.js → voice-reply-DPbxkmsy.js} +1 -1
- package/dist/ui/assets/{wc-attach-CFj2ZF5_.js → wc-attach-C-7ZwxKV.js} +2 -2
- package/dist/ui/assets/{wc-browser-BFL2Tl8W.js → wc-browser-D-03DBqa.js} +1 -1
- package/dist/ui/assets/wc-computers-m_Qiklfg.js +3 -0
- package/dist/ui/assets/{wc-detached-ncc8KuL1.js → wc-detached-D5_bAfyn.js} +1 -1
- package/dist/ui/assets/{wc-extension-DppNe2VK.js → wc-extension-DSvNnUY6.js} +2 -2
- package/dist/ui/assets/{wc-follower-CcxFCW-y.js → wc-follower-1feBQ0f-.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-DQ-JPxl6.js → wc-follower-oauth-JZo8mi8y.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-CANPh9TU.js → wc-gelatiere-Wr8PEKDG.js} +1 -1
- package/dist/ui/assets/{wc-live-BLozTZsg.js → wc-live-DT1WB50h.js} +17 -17
- package/dist/ui/assets/{wc-nav-BlLpBAJG.js → wc-nav-BCq8EXtI.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-OKaUOQ3X.js → wc-onboarding-1l4fZpDo.js} +2 -2
- package/dist/ui/assets/{wc-permissions-BsGMi4OQ.js → wc-permissions-CCA-0PP4.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-BrX9-mPv.js → wc-placeholder-ODIHzW-8.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-QPmTs_eW.js → wc-secret-request-CWyoYT_T.js} +1 -1
- package/dist/ui/assets/{wc-settings-BFgFDtTk.js → wc-settings-Df49ivPm.js} +3 -3
- package/dist/ui/assets/{wc-shell-CCKjmASt.js → wc-shell-CZ95TYrc.js} +4 -4
- package/dist/ui/assets/{wc-shortcut-config-CeUoljrV.js → wc-shortcut-config-CmRCkDN0.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-BNp18_jW.js → wc-sprinkles-Cm0F47mC.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-DJnnZ8L-.js → wc-transcript-export-CMdPvQk4.js} +2 -2
- package/dist/ui/assets/{wc-tray-f1LxbB98.js → wc-tray-2XQPor_4.js} +4 -4
- package/dist/ui/assets/welcome-detection-CouG8kRR.js +1 -0
- package/dist/ui/assets/{whisper-session-CMiImrJg.js → whisper-session-z9qnQTAM.js} +2 -2
- package/dist/ui/assets/{xai-grok-BMr5udF6.js → xai-grok-BmuhN83h.js} +1 -1
- package/dist/ui/assets/{xai-grok-Dzeo18XM.js → xai-grok-CaNUqqnT.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/dist/ui/packages/webapp/index.html +9 -9
- package/package.json +1 -1
- package/dist/ui/assets/SKILL-CWR-bsvH.js +0 -1
- package/dist/ui/assets/browser-2rCVqcqy.js +0 -1
- package/dist/ui/assets/core-Bvc89tkf.js +0 -36
- package/dist/ui/assets/es-DwGGEZle.js +0 -51
- package/dist/ui/assets/keys-Dexx8cLD.js +0 -1
- package/dist/ui/assets/lick-ws-bridge-DZ0vVYNF.js +0 -1
- package/dist/ui/assets/memory-v2-flag-DVbOtPFF.js +0 -1
- package/dist/ui/assets/panel-rpc-handlers-CQ_iaU6N.js +0 -2
- package/dist/ui/assets/provider-store-access-BJPbOUku.js +0 -1
- package/dist/ui/assets/provider-store-access-BrjCBzpb.js +0 -1
- package/dist/ui/assets/run-DvD576xV.js +0 -53
- package/dist/ui/assets/screencapture-media-DL5YxrlG.js +0 -1
- package/dist/ui/assets/screencapture-media-YBE2VnLF.js +0 -1
- package/dist/ui/assets/secret-topology-CVneCnID.js +0 -1
- package/dist/ui/assets/slicc-version-CN6V2aMa.js +0 -1
- package/dist/ui/assets/sudo-fs-D620mZry.js +0 -3
- package/dist/ui/assets/v86-BfdTUFBK.js +0 -1
- package/dist/ui/assets/wc-computers-CcJuQUyG.js +0 -3
- package/dist/ui/assets/welcome-detection-Dg9THpkh.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./main-
|
|
1
|
+
import{l as e}from"./main-BRoNZPBl.js";async function t(){try{let e=await navigator.serviceWorker?.getRegistrations?.();e&&await Promise.all(e.map(e=>e.unregister().catch(()=>!1)))}catch{}try{let e=await indexedDB.databases();await Promise.all(e.filter(e=>!!e.name).map(e=>new Promise(t=>{let n=indexedDB.deleteDatabase(e.name);n.onsuccess=()=>t(),n.onerror=()=>t(),n.onblocked=()=>t()})))}catch{}try{let e=navigator.storage;if(typeof e?.getDirectory==`function`){let t=await e.getDirectory(),n=[];for await(let e of t.keys())n.push(e);await Promise.all(n.map(e=>t.removeEntry(e,{recursive:!0}).catch(()=>{})))}}catch{}}function n(n,r,i={}){if(n.dataset.recoveryBusy===`1`)return;let a=i.wipe??t,o=i.reload??(()=>location.reload()),s=r instanceof Error?r.message:String(r),c=i.verdict===`browser-wedged`,l=document.createElement(`div`);l.style.cssText=`padding:2rem;text-align:center;font-family:system-ui;`;let u=document.createElement(`h1`);u.style.color=`var(--s2-negative, #e34850)`,u.textContent=c?`Your browser needs a restart`:`Failed to start`;let d=document.createElement(`p`);d.style.color=`var(--s2-content-tertiary, #717171)`,d.textContent=s;let f=document.createElement(`div`);f.style.cssText=`display:flex;gap:0.75rem;justify-content:center;flex-wrap:wrap;margin-top:1.5rem;`;let p=document.createElement(`button`);p.type=`button`,p.textContent=`Reset local data & reload`,p.dataset.variant=c?`demoted`:`destructive`,p.style.cssText=c?`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-content-tertiary, #717171);background:transparent;color:inherit;border-radius:4px;`:`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-negative, #e34850);background:var(--s2-negative, #e34850);color:#fff;border-radius:4px;`;let m=document.createElement(`button`);if(m.type=`button`,m.textContent=`Reload`,m.style.cssText=c?`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-accent, #0265dc);background:var(--s2-accent, #0265dc);color:#fff;border-radius:4px;`:`padding:0.5rem 1rem;cursor:pointer;border:1px solid var(--s2-content-tertiary, #717171);background:transparent;color:inherit;border-radius:4px;`,p.addEventListener(`click`,()=>{p.disabled=!0,m.disabled=!0,p.textContent=`Resetting…`,n.dataset.recoveryBusy=`1`,(async()=>{try{await a()}catch{}for(let t of e)try{localStorage.removeItem(t)}catch{}o()})()}),m.addEventListener(`click`,()=>{o()}),c){let e=document.createElement(`p`);e.style.cssText=`max-width:34rem;margin:1rem auto 0;`,e.textContent=`This browser has stopped starting web workers — a browser process issue, not a problem with your data. Quit the browser completely, reopen it, and come back. Your local data is intact; resetting it will not fix this.`,l.append(u,d,e),f.append(m,p)}else l.append(u,d),f.append(p,m);for(l.append(f);n.firstChild;)n.removeChild(n.firstChild);n.appendChild(l)}export{n as renderBootRecoveryScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function e(e){if(e===`extension-direct`){let e=chrome;return e.identity?.getRedirectURL?.(`mcp-callback`)??`https://${e.runtime?.id??``}.chromiumapp.org/mcp-callback`}if(e===`node-rest`){let{getLocalApiBaseUrl:e}=await import(`./proxied-fetch-
|
|
1
|
+
async function e(e){if(e===`extension-direct`){let e=chrome;return e.identity?.getRedirectURL?.(`mcp-callback`)??`https://${e.runtime?.id??``}.chromiumapp.org/mcp-callback`}if(e===`node-rest`){let{getLocalApiBaseUrl:e}=await import(`./proxied-fetch-CPL8wJM2.js`).then(e=>e.i),t=e();if(t)return`${t}/auth/callback`}let{getOAuthPageOrigin:t}=await import(`./oauth-service-CRmx6zI1.js`),{origin:n}=await t();return`${n}${e===`extension-delegate`?`/auth/mcp-callback`:`/auth/callback`}`}export{e as t};
|
package/dist/ui/assets/{remote-terminal-view-D4Ah4AQY.js → remote-terminal-view-CA-SfvvZ.js}
RENAMED
|
@@ -2,5 +2,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/readline-BOCWRK
|
|
|
2
2
|
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./preload-helper-Czpn1I53.js";import"./tool-ui-eSQ1g2I1.js";import{t as n}from"./permissions-surface-registry-CilCRwhh.js";import{storePendingHandle as r}from"./mount-picker-popup--ijSfN8u.js";import{r as i,t as a}from"./hid-device-registry-B2R-0rNt.js";import"./browser-DGwroBSO.js";import{a as o,n as s}from"./serial-port-registry-CCqklAEr.js";import{a as c,t as l}from"./usb-device-registry--JwKRTYp.js";import"./usb-operations-v1mGAdRY.js";import{t as u}from"./terminal-session-client-ADzaWGFd.js";function d(e,t){let n=[],r=new Map,i=new Set;for(let a=0;a<e.length;a++){let o=e[a];o.startsWith(`-`)?t.has(o)?r.set(o,e[++a]??``):i.add(o):n.push(o)}return{positionals:n,flags:r,bools:i}}new TextDecoder(`utf-8`,{fatal:!1}),new TextEncoder;var f=new Set([`--vid`,`--pid`,`--baud`,`--data-bits`,`--stop-bits`,`--parity`,`--flow-control`,`--buffer-size`,`--bytes`,`--until`,`--timeout-ms`,`--dtr`,`--rts`,`--break`,`--__resolved`]);function p(e){return d(e,f)}function m(e,t){let n=/^0x/i.test(e)?parseInt(e,16):parseInt(e,10);if(!Number.isFinite(n)||Number.isNaN(n))throw Error(`invalid ${t}: '${e}'`);return n}function h(e){let t={};return e.has(`--vid`)&&(t.usbVendorId=m(e.get(`--vid`),`vid`)),e.has(`--pid`)&&(t.usbProductId=m(e.get(`--pid`),`pid`)),Object.keys(t).length>0?[t]:[]}`${s}${s}`;var g=new Set([`--port`,`--baud`,`--vid`,`--pid`]),_=115200;function v(e){return d(e,g)}`${_}`;var y=new Set([`--vid`,`--pid`,`--usage-page`,`--usage`,`--__resolved`,`--timeout`]);function b(e){return d(e,y)}function x(e,t){let n=/^0x/i.test(e)?parseInt(e,16):parseInt(e,10);if(!Number.isFinite(n)||Number.isNaN(n))throw Error(`invalid ${t}: '${e}'`);return n}function S(e){let t={};return e.has(`--vid`)&&(t.vendorId=x(e.get(`--vid`),`vid`)),e.has(`--pid`)&&(t.productId=x(e.get(`--pid`),`pid`)),e.has(`--usage-page`)&&(t.usagePage=x(e.get(`--usage-page`),`usage-page`)),e.has(`--usage`)&&(t.usage=x(e.get(`--usage`),`usage`)),Object.keys(t).length>0?[t]:[]}`${a}`;var C=new Set([`--vid`,`--pid`,`--class`,`--subclass`,`--protocol`,`--serial`,`--request-type`,`--recipient`,`--request`,`--value`,`--index`,`--__resolved`]);function w(e){return d(e,C)}function T(e,t){let n=/^0x/i.test(e)?parseInt(e,16):parseInt(e,10);if(!Number.isFinite(n)||Number.isNaN(n))throw Error(`invalid ${t}: '${e}'`);return n}function E(e){let t={};return e.has(`--vid`)&&(t.vendorId=T(e.get(`--vid`),`vid`)),e.has(`--pid`)&&(t.productId=T(e.get(`--pid`),`pid`)),e.has(`--class`)&&(t.classCode=T(e.get(`--class`),`class`)),e.has(`--subclass`)&&(t.subclassCode=T(e.get(`--subclass`),`subclass`)),e.has(`--protocol`)&&(t.protocolCode=T(e.get(`--protocol`),`protocol`)),e.has(`--serial`)&&(t.serialNumber=e.get(`--serial`)),Object.keys(t).length>0?[t]:[]}`${l}`;var D={background:`#141414`,foreground:`#f2f2f2`,cursor:`#3562ff`,cursorAccent:`#141414`,selectionBackground:`#3562ff40`,selectionForeground:`#ffffff`,black:`#1a1a1a`,red:`#e34850`,green:`#2d9d78`,yellow:`#e68619`,blue:`#3562ff`,magenta:`#a962e8`,cyan:`#2db9be`,white:`#f2f2f2`,brightBlack:`#5a5a5a`,brightRed:`#e34850`,brightGreen:`#2d9d78`,brightYellow:`#e68619`,brightBlue:`#4a75ff`,brightMagenta:`#a962e8`,brightCyan:`#2db9be`,brightWhite:`#ffffff`},O={background:`#f0f0f0`,foreground:`#1a1a1a`,cursor:`#2b54db`,cursorAccent:`#f0f0f0`,selectionBackground:`#2b54db30`,selectionForeground:`#000000`,black:`#1a1a1a`,red:`#d73220`,green:`#268e6c`,yellow:`#d17a00`,blue:`#2b54db`,magenta:`#8839ef`,cyan:`#1a9088`,white:`#e8e8e8`,brightBlack:`#6e6e6e`,brightRed:`#d73220`,brightGreen:`#268e6c`,brightYellow:`#d17a00`,brightBlue:`#1e44c4`,brightMagenta:`#8839ef`,brightCyan:`#1a9088`,brightWhite:`#ffffff`},k=`\x1B[34m/\x1B[0m \x1B[90m$\x1B[0m `,A=class{options;client;terminal=null;fitAddon=null;terminalHost=null;previewHost=null;previewUrls=[];hasPreview=!1;previewStateListener=null;resizeObserver=null;themeObserver=null;readline=null;disposed=!1;abortPromptLoop=null;programmaticResolve=null;isExecuting=!1;suppressOutput=!1;tabBusy=!1;constructor(e){this.options=e;let t=e.sid??`panel-terminal-${Date.now()}`;this.client=new u({client:e.client,sid:t,onEvent:e=>this.handleEvent(e)})}async mount(n){let{Terminal:r}=await t(async()=>{let{Terminal:e}=await import(`./xterm-C3BHN0de.js`);return{Terminal:e}},[]),{FitAddon:i}=await t(async()=>{let{FitAddon:e}=await import(`./addon-fit-DIOBYJe3.js`);return{FitAddon:e}},[]),{Readline:a}=await t(async()=>{let{Readline:t}=await import(`./readline-BOCWRKSR.js`).then(t=>e(t.default,1));return{Readline:t}},__vite__mapDeps([0,1]));await t(()=>Promise.resolve({}),__vite__mapDeps([2]));let o=!document.documentElement.classList.contains(`theme-light`);this.terminal=new r({cursorBlink:!0,fontSize:11,fontFamily:`'Source Code Pro', 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace`,theme:o?D:O,convertEol:!0}),this.themeObserver=new MutationObserver(()=>{if(!this.terminal)return;let e=document.documentElement.classList.contains(`theme-light`);this.terminal.options.theme=e?O:D}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),this.fitAddon=new i,this.terminal.loadAddon(this.fitAddon),n.replaceChildren(),this.terminalHost=document.createElement(`div`),this.terminalHost.className=`terminal-panel__terminal-host`,n.appendChild(this.terminalHost),this.previewHost=document.createElement(`div`),this.previewHost.className=`terminal-panel__preview`,n.appendChild(this.previewHost),this.terminal.open(this.terminalHost),this.fitAddon.fit(),this.resizeObserver=new ResizeObserver(()=>this.refit()),this.resizeObserver.observe(this.terminalHost),this.readline=new a,this.neutralizeReadlineHistoryPersistence(),this.terminal.loadAddon(this.readline),this.readline.setCtrlCHandler(()=>this.signalInterruptDuringExec()),this.setupInput(),this.terminal.writeln(`\x1B[1mslicc\x1B[0m \x1B[90mshell (kernel)\x1B[0m`),this.terminal.writeln(`\x1B[90mType "help" for available commands.\x1B[0m
|
|
3
3
|
`),await this.client.open({cwd:this.options.cwd,env:this.options.env}),this.runPromptLoop()}refit(){this.fitAddon?.fit()}clearTerminal(){this.terminal?.clear()}async executeCommandInTerminal(e){let t=e.trim();if(!t)return{stdout:``,stderr:``,exitCode:0};if(!this.terminal||!this.readline)return this.client.exec(t);if(this.isExecuting||this.programmaticResolve||this.readline.getLine().length>0)return{stdout:``,stderr:`terminal is busy; finish current input first
|
|
4
4
|
`,exitCode:1};let n=new Promise(e=>{this.programmaticResolve=e});return this.readline.updateLine(t),this.terminal.input(`\r`),n}setPreviewStateListener(e){this.previewStateListener=e,e?.(this.hasPreview)}dispose(){this.disposed=!0,this.abortPromptLoop?.(Error(`terminal disposed`)),this.abortPromptLoop=null,this.clearMediaPreview(),this.themeObserver?.disconnect(),this.themeObserver=null,this.resizeObserver?.disconnect(),this.resizeObserver=null,this.terminal?.dispose(),this.terminal=null,this.readline=null,this.fitAddon=null,this.terminalHost=null,this.previewHost=null,this.client.close(),this.client.dispose()}renderMediaPreview(e){if(!this.previewHost)return;let t=Uint8Array.from(atob(e.data),e=>e.charCodeAt(0)),n=URL.createObjectURL(new Blob([t],{type:e.mediaType}));this.previewUrls.push(n);let r=document.createElement(`div`);r.className=`terminal-panel__preview-item`;let i=document.createElement(`div`);i.className=`terminal-panel__preview-label`;let a=e.path.split(`/`).pop()??e.path;if(i.textContent=`${a} · ${e.mediaType}`,r.appendChild(i),e.mediaType.startsWith(`video/`)){let e=document.createElement(`video`);e.className=`terminal-panel__preview-media`,e.controls=!0,e.autoplay=!0,e.loop=!0,e.muted=!0,e.playsInline=!0,e.src=n,e.addEventListener(`loadedmetadata`,()=>this.refit(),{once:!0}),r.appendChild(e)}else{let e=document.createElement(`img`);e.className=`terminal-panel__preview-media`,e.alt=a,e.src=n,e.addEventListener(`load`,()=>this.refit(),{once:!0}),r.appendChild(e)}this.previewHost.appendChild(r),this.previewHost.classList.add(`terminal-panel__preview--visible`),this.hasPreview=!0,this.previewStateListener?.(!0)}clearMediaPreview(){for(let e of this.previewUrls)URL.revokeObjectURL(e);this.previewUrls=[],this.previewHost&&(this.previewHost.replaceChildren(),this.previewHost.classList.remove(`terminal-panel__preview--visible`)),this.hasPreview=!1,this.previewStateListener?.(!1)}async runPromptLoop(){for(;!this.disposed&&this.readline&&this.terminal;){let e;try{e=await this.readNextLine()}catch{break}finally{this.abortPromptLoop=null}let t=this.programmaticResolve!==null,n=await this.processLine(e,t);this.programmaticResolve&&=(this.programmaticResolve(n),null)}}readNextLine(){let e=this.terminal,t=this.readline;if(!e||!t)return Promise.reject(Error(`terminal not mounted`));let n=new Promise((e,t)=>{this.abortPromptLoop=t}),r=new Promise((n,r)=>{e.write(``,()=>{e.buffer.active.cursorX>0&&e.write(`\x1B[7m%\x1B[0m\r
|
|
5
|
-
`),t.read(k).then(n,r)})});return Promise.race([r,n])}async processLine(e,t=!1){let n=e.trim();return!n||!t&&await this.tryRunPicker(n)?{stdout:``,stderr:``,exitCode:0}:this.runRemote(n)}async tryRunPicker(e){let t=j(e);if(t)return await this.runRemoteWithLocalPicker(e,t),!0;let n=
|
|
6
|
-
`).filter(Boolean);if(i.length===0)return;if(i.length===1){let n=i[0],r=n.slice(e.length);r&&this.terminal.input(r);let a=` `;if(!t){this.suppressOutput=!0;try{(await this.client.exec(
|
|
5
|
+
`),t.read(k).then(n,r)})});return Promise.race([r,n])}async processLine(e,t=!1){let n=e.trim();return!n||!t&&await this.tryRunPicker(n)?{stdout:``,stderr:``,exitCode:0}:this.runRemote(n)}async tryRunPicker(e){let t=j(e);if(t)return await this.runRemoteWithLocalPicker(e,t),!0;let n=R(e);if(n)return await this.runRemoteWithUsbPicker(n),!0;let r=z(e);if(r)return await this.runRemoteWithHidPicker(r),!0;let i=V(e);if(i)return await this.runRemoteWithSerialPicker(i),!0;let a=H(e);if(a)return await this.runRemoteWithEsptoolPicker(e,a),!0;let o=L(e);return o?(await this.runRemoteWithScreenShare(o.name),!0):!1}setupInput(){this.terminal&&(this.terminal.onData(e=>{e===` `&&this.handleTab()}),this.terminal.attachCustomKeyEventHandler(e=>!(e.type===`keydown`&&e.key===`Enter`&&this.tabBusy)))}signalInterruptDuringExec(){this.isExecuting&&(this.terminal?.writeln(`^C`),this.client.signal(`SIGINT`))}neutralizeReadlineHistoryPersistence(){let e=this.readline.history;e&&(e.entries=[],e.cursor=-1,e.saveToLocalStorage=()=>void 0,e.restoreFromLocalStorage=()=>void 0)}reanchorReadline(){if(!this.terminal||!this.readline)return;let e=this.readline.state;e&&(e.getTty().anchorRow=this.terminal.buffer.active.cursorY,e.refresh())}async handleTab(){if(!(!this.terminal||!this.readline)&&!(this.isExecuting||this.tabBusy)){this.tabBusy=!0,this.isExecuting=!0;try{let{currentWord:e,isFirstWord:t,compgenCmd:n}=W(this.readline.getLine());this.suppressOutput=!0;let r=``;try{r=(await this.client.exec(n)).stdout}finally{this.suppressOutput=!1}let i=r.split(`
|
|
6
|
+
`).filter(Boolean);if(i.length===0)return;if(i.length===1){let n=i[0],r=n.slice(e.length);r&&this.terminal.input(r);let a=` `;if(!t){this.suppressOutput=!0;try{(await this.client.exec(G(n))).stdout.trim()===n&&(a=`/`)}finally{this.suppressOutput=!1}}this.terminal.input(a);return}let a=K(i).slice(e.length);if(a){this.terminal.input(a);return}this.readline.println(``),this.readline.println(i.map(e=>e.split(`/`).pop()??e).join(` `)),this.reanchorReadline()}catch(e){console.warn(`[RemoteTerminal] Tab completion failed:`,e instanceof Error?e.message:String(e))}finally{this.tabBusy=!1,this.isExecuting=!1}}}async requestPermission(e,t){let r=n();if(!r)return{ok:!1,reason:`unavailable`,message:`permission surface not mounted`};let i={current:null},a=t=>{let n=t.detail;n.kind===e&&(i.current=n)};r.addEventListener(`slicc-permission-deny`,a);try{let n=await r.request(e,t);if(n)return{ok:!0,grant:n};let a=i.current;return{ok:!1,reason:a?.reason??`error`,...a?.message?{message:a.message}:{}}}finally{r.removeEventListener(`slicc-permission-deny`,a)}}writePickerDenial(e,t,n){if(this.terminal){if(t.reason===`cancelled`){this.terminal.writeln(`${e}: cancelled`);return}if(t.reason===`unavailable`){this.terminal.writeln(`${e}: ${n}`);return}this.terminal.writeln(`${e}: ${t.message??`unknown error`}`)}}async runRemoteWithUsbPicker(e){this.isExecuting=!0;try{let t=await this.requestPermission(`usb`,{filters:e});if(!t.ok){this.writePickerDenial(`usb`,t,`WebUSB is not available in this browser`);return}let n=t.grant,r=c().register(n.device);await this.client.exec(`usb request --__resolved ${r}`)}finally{this.isExecuting=!1}}async runRemoteWithHidPicker(e){this.isExecuting=!0;try{let t=await this.requestPermission(`hid`,{filters:e});if(!t.ok){this.writePickerDenial(`hid`,t,`WebHID is not available in this browser`);return}let n=t.grant,r=i(),a=n.devices.map(e=>r.register(e)),o=B(e[0]);await this.client.exec(`hid request --__resolved ${a.join(`,`)}${o}`)}finally{this.isExecuting=!1}}async runRemoteWithSerialPicker(e){this.isExecuting=!0;try{let t=await this.requestPermission(`serial`,e.length?{filters:e}:void 0);if(!t.ok){this.writePickerDenial(`serial`,t,`Web Serial is not available in this browser`);return}let n=t.grant,r=o().register(n.port);await this.client.exec(`serial request --__resolved ${r}`)}finally{this.isExecuting=!1}}async runRemoteWithEsptoolPicker(e,t){this.isExecuting=!0;try{let n=await this.requestPermission(`serial`,t.length?{filters:t}:void 0);if(!n.ok){this.writePickerDenial(`esptool`,n,`Web Serial is not available in this browser`);return}let r=n.grant,i=o().register(r.port);await this.client.exec(`${e.trim()} --port ${i}`)}finally{this.isExecuting=!1}}async runRemoteWithScreenShare(e){this.isExecuting=!0;try{let n=await this.requestPermission(`screenshare`,{constraints:{video:!0}});if(!n.ok){this.writePickerDenial(`computer`,n,`screen capture is not available in this browser`);return}let r=n.grant,{adoptDisplayStream:i,displaySessions:a}=await t(async()=>{let{adoptDisplayStream:e,displaySessions:t}=await import(`./screencapture-media-CM5E2g6c.js`);return{adoptDisplayStream:e,displaySessions:t}},[]),o=await i(r.stream);if(!o.handle){this.terminal?.writeln(`computer: screen share produced no handle`);return}await I(e=>this.client.exec(e),e=>{a.stop(e)},o.handle,e)}finally{this.isExecuting=!1}}async runRemoteWithLocalPicker(e,t){this.isExecuting=!0;try{let n=await this.requestPermission(`filesystem`);if(!n.ok){this.writePickerDenial(`mount`,n,`File System Access API not available`);return}let i=n.grant;try{await r(M(t),i.handle)}catch(e){let t=e instanceof Error?e.message:String(e);this.terminal?.writeln(`mount: failed to stash handle: ${t}`);return}await this.client.exec(e)}finally{this.isExecuting=!1}}async runRemote(e){this.isExecuting=!0,this.clearMediaPreview();try{return await this.client.exec(e)}finally{this.isExecuting=!1}}handleEvent(e){if(this.terminal)switch(e.type){case`terminal-output`:if(this.suppressOutput)return;e.stream===`stderr`?this.terminal.write(`\x1b[31m${e.data}\x1b[0m`):this.terminal.write(e.data);return;case`terminal-exit`:return;case`terminal-cleared`:this.terminal.clear();return;case`terminal-status`:e.state===`error`&&this.terminal.writeln(`\x1b[31mterminal session error: ${e.error??`unknown`}\x1b[0m`);return;case`terminal-media-preview`:this.renderMediaPreview(e);return}}};function j(e){let t=e.trim();if(!t.startsWith(`mount`))return null;let n=t.split(/\s+/);if(n[0]!==`mount`||n.includes(`--source`)||n.includes(`--help`)||n.includes(`-h`)||n.includes(`--list`)||n.includes(`-l`)||n.includes(`--json`))return null;let r=n.slice(1).find(e=>!e.startsWith(`-`));return!r||[`list`,`unmount`,`refresh`,`recover`,`info`].includes(r)||!r.startsWith(`/`)?null:r}function M(e){return`pendingMount:term:${e}`}function N(e){let t=[],n=``,r=null,i=!1;for(let a of e.trim()){if(i){n+=a,i=!1;continue}if(r===`"`&&a===`\\`){i=!0;continue}if(r){a===r?r=null:n+=a;continue}if(a===`\\`){i=!0;continue}if(a===`"`||a===`'`){r=a;continue}if(/\s/.test(a)){n.length>0&&(t.push(n),n=``);continue}n+=a}return n.length>0&&t.push(n),t}function P(e){return e===``?`''`:/^[A-Za-z0-9_./:=@%+-]+$/.test(e)?e:e.includes(`"`)&&!e.includes(`'`)?`'${e}'`:`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function F(e,t){let n=[`computer`,`add`,`screen`,`--__resolved`,e];return t!==void 0&&n.push(`-n`,t),n.map(P).join(` `)}async function I(e,t,n,r){try{let i=await e(F(n,r));return i.exitCode!==0&&t(n),i}catch(e){throw t(n),e}}function L(e){let t=N(e);if(t[0]!==`computer`||t[1]!==`add`||t[2]!==`screen`||t.includes(`--__resolved`)||t.includes(`--help`)||t.includes(`-h`))return null;let n=t.findIndex(e=>e===`-n`||e===`--name`),r=n===-1?void 0:t[n+1];return r?{name:r}:{}}function R(e){let t=e.trim().split(/\s+/);if(t[0]!==`usb`||t[1]!==`request`||t.includes(`--__resolved`)||t.includes(`--help`)||t.includes(`-h`))return null;let{flags:n}=w(t.slice(2));return E(n)}function z(e){let t=e.trim().split(/\s+/);if(t[0]!==`hid`||t[1]!==`request`||t.includes(`--__resolved`)||t.includes(`--help`)||t.includes(`-h`))return null;let{flags:n}=b(t.slice(2));return S(n)}function B(e){if(!e)return``;let t=[];return e.usagePage!==void 0&&t.push(`--usage-page 0x${e.usagePage.toString(16)}`),e.usage!==void 0&&t.push(`--usage 0x${e.usage.toString(16)}`),t.length>0?` ${t.join(` `)}`:``}function V(e){let t=e.trim().split(/\s+/);if(t[0]!==`serial`||t[1]!==`request`||t.includes(`--__resolved`)||t.includes(`--help`)||t.includes(`-h`))return null;let{flags:n}=p(t.slice(2));return h(n)}function H(e){let t=e.trim().split(/\s+/);if(t[0]!==`esptool`||t.includes(`--port`)||t.includes(`--help`)||t.includes(`-h`))return null;let{positionals:n,flags:r}=v(t.slice(1));return n.length===0?null:h(r)}function U(e){return e.length===0?`''`:`'${e.replace(/'/g,`'\\''`)}'`}function W(e){let t=e.split(/\s+/),n=t[t.length-1]??``,r=t.length<=1||t.length===2&&t[0]===``,i=U(n);return{currentWord:n,isFirstWord:r,compgenCmd:r?`compgen -A command -- ${i}`:`compgen -f -- ${i}`}}function G(e){return`compgen -d -- ${U(e)}`}function K(e){if(e.length===0)return``;let t=e[0];for(let n of e){for(;t.length>0&&!n.startsWith(t);)t=t.slice(0,-1);if(t.length===0)break}return t}export{A as RemoteTerminalView,M as localMountIdbKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./base64-ELzoYfwP.js";import{c as n,l as r,r as i,s as a,t as o}from"./proxied-fetch-
|
|
1
|
+
import{r as e,t}from"./base64-ELzoYfwP.js";import{c as n,l as r,r as i,s as a,t as o}from"./proxied-fetch-CnCvBaGV.js";import{t as s}from"./fetch-body-1l9I58Vk.js";import{a as c,t as l}from"./api-endpoint-DGxXvrur.js";import{t as u}from"./approval-decision-CS9Wwm5B.js";import{a as d,i as f,n as p,r as m}from"./capability-SIitRcq_.js";var h=new Set([`GET`,`HEAD`]);function g(e){let n=(e.method??`GET`).toUpperCase();if(e.body===void 0||h.has(n))return;if(e.bodyEncoding===`base64`)return t(e.body);let i=Object.entries(e.headers??{}).find(([e])=>e.toLowerCase()===`content-type`)?.[1]??``;return i&&!r(i)?s(e.body):new TextEncoder().encode(e.body)}var _=m,v=12e4;function y(e){return e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`)}function b(e,t,n){if(n)return t;let r=AbortSignal.timeout(e);return t&&typeof AbortSignal.any==`function`?AbortSignal.any([r,t]):r}function x(e){let t=e.fetchImpl??((...e)=>globalThis.fetch(...e)),n=e.resolveUrl??c,r=e.headers??l,i=e.controlTimeoutMs??_;async function a(e,r){try{return await t(n(e),r)}catch(e){return e instanceof Error?e:Error(String(e))}}return{headers:r,send:a,async callJson(e,t,n,o){let s=o?.timeoutMs??i,c=b(s,o?.signal,o?.humanPaced===!0),l={method:e,headers:r({"Content-Type":`application/json`}),...c?{signal:c}:{}};n!==void 0&&(l.body=JSON.stringify(n));let u=await a(t,l);if(u instanceof Error)return{status:0,ok:!1,body:{error:y(u)?`no answer within ${s}ms`:u.message}};let d=await u.json().catch(()=>void 0);return{status:u.status,ok:u.ok,body:d}}}}function S(e,t){let n=e.body?.error;return typeof n==`string`&&n.length>0?n:e.status===0?`${t} (transport unreachable)`:`${t} (HTTP ${e.status})`}function C(e){return e.status===0?void 0:e.status}function w(e,t,n,r){return f(e,t,S(n,r),C(n))}async function T(e,t){let n=await e.callJson(`GET`,p.secretsMasked);return n.ok?Array.isArray(n.body)?{ok:!0,value:n.body}:f(`secrets`,t,`masked secrets response is not an array`):w(`secrets`,t,n,`masked secrets request failed`)}function E(e){return{async listMaskedEnv(){let t=await T(e,`listMaskedEnv`);return t.ok?{ok:!0,value:{entries:t.value}}:t},async getMasked(t){let n=await T(e,`getMasked`);if(!n.ok)return n;let r=n.value.find(e=>e.name===t.name);return r?{ok:!0,value:r}:f(`secrets`,`getMasked`,`no secret named "${t.name}"`,404)},async set(t){let n=t.scope===`persisted`,r=n?p.secretsPersisted:p.secretsSession,i=await e.callJson(`POST`,r,{name:t.name,value:t.value,domains:[...t.domains??[]]});return n&&i.status===404?d(`secrets`,`set`,`this server has no persisted-secret write route (upgrade it; the route shipped in #2823), retry with scope: 'session'`):i.ok?{ok:!0,value:void 0}:w(`secrets`,`set`,i,`set secret failed`)},async delete(t){let n=await e.callJson(`DELETE`,`${p.secretsPersisted}/${encodeURIComponent(t.name)}`);if(!n.ok)return w(`secrets`,`delete`,n,`delete secret failed`);let r=n.body;return{ok:!0,value:{removed:r?.removed??!0,fromSession:r?.fromSession===!0}}}}}async function D(t,s){let c={method:s.method??`GET`,headers:t.headers({...n(s.headers),"X-Target-URL":s.url}),cache:`no-store`};s.signal&&(c.signal=s.signal);let l=g(s);if(l!==void 0){if(l.byteLength>33554432)return f(`network`,`crossOriginFetch`,`request body is ${l.byteLength} bytes, over the ${o}-byte proxy limit`);c.body=l}let u=await t.send(p.fetchProxy,c);if(u instanceof Error)return f(`network`,`crossOriginFetch`,y(u)?`request cancelled`:u.message);if(u.headers.get(`x-proxy-error`)===`1`){let e=await u.text().catch(()=>``);return f(`network`,`crossOriginFetch`,e||`fetch-proxy reported an error`,u.status)}let d=i(),m=Number(u.headers.get(`content-length`)??``);if(Number.isFinite(m)&&m>d)return f(`network`,`crossOriginFetch`,`response body is ${m} bytes, over the ${d}-byte download limit`,u.status);let h;try{h=new Uint8Array(await u.arrayBuffer())}catch(e){return f(`network`,`crossOriginFetch`,y(e)?`response body cancelled`:`response body failed: ${e instanceof Error?e.message:String(e)}`,u.status)}if(h.byteLength>d)return f(`network`,`crossOriginFetch`,`response body is ${h.byteLength} bytes, over the ${d}-byte download limit`,u.status);let _={};u.headers.forEach((e,t)=>{_[t]=e});let v=a(_),b=r(v[`content-type`]??``);return{ok:!0,value:{status:u.status,ok:u.ok,statusText:u.statusText,headers:v,body:b?new TextDecoder().decode(h):e(h),bodyEncoding:b?`text`:`base64`,url:s.url}}}async function O(e,t){let n=t.backend===`s3`?p.s3SignAndForward:p.daSignAndForward,r=await e.callJson(`POST`,n,t.envelope,{timeoutMs:v}),i=r.body;return i&&typeof i==`object`&&typeof i.ok==`boolean`?{ok:!0,value:i}:w(`mounts`,`signRequest`,r,`sign-and-forward response is not an envelope`)}async function k(e,t){let n=t.suggestedPattern??t.detail,r=await e.callJson(`POST`,p.sudoApprove,{kind:t.kind,detail:t.detail,suggestedPattern:n,...t.requester?{requester:t.requester}:{},...t.reason?{reason:t.reason}:{},...t.approver?{approver:t.approver}:{}},{humanPaced:!0,...t.signal?{signal:t.signal}:{}});return r.ok?{ok:!0,value:u(r.body,n)}:w(`approvals`,`request`,r,`approval endpoint returned non-OK`)}function A(e){let t=x(e);return{crossOriginFetch:e=>D(t,e),secrets:E(t),signRequest:e=>O(t,e),requestApproval:e=>k(t,e)}}export{A as createRestOps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./base64-BPBW1Gzr.js";import{t}from"./content-type-_QKWY0B2.js";import{c as n,r,s as i,t as a}from"./proxied-fetch-
|
|
1
|
+
import{r as e}from"./base64-BPBW1Gzr.js";import{t}from"./content-type-_QKWY0B2.js";import{c as n,r,s as i,t as a}from"./proxied-fetch-CPL8wJM2.js";import{o,t as s}from"./api-endpoint-3qEcn7BY.js";import{c,l,s as u}from"./types-BfwydWt7.js";import{n as d,t as f}from"./rest-paths-Dia19u9P.js";import{t as p}from"./request-body-BF4moGct.js";const m=d;function h(e){return e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`)}function g(e,t,n){if(n)return t;let r=AbortSignal.timeout(e);return t&&typeof AbortSignal.any==`function`?AbortSignal.any([r,t]):r}function _(e){let t=e.fetchImpl??((...e)=>globalThis.fetch(...e)),n=e.resolveUrl??o,r=e.headers??s,i=e.controlTimeoutMs??m;async function a(e,r){try{return await t(n(e),r)}catch(e){return e instanceof Error?e:Error(String(e))}}return{headers:r,send:a,async callJson(e,t,n,o){let s=o?.timeoutMs??i,c=g(s,o?.signal,o?.humanPaced===!0),l={method:e,headers:r({"Content-Type":`application/json`}),...c?{signal:c}:{}};n!==void 0&&(l.body=JSON.stringify(n));let u=await a(t,l);if(u instanceof Error)return{status:0,ok:!1,body:{error:h(u)?`no answer within ${s}ms`:u.message}};let d=await u.json().catch(()=>void 0);return{status:u.status,ok:u.ok,body:d}}}}function v(e,t){let n=e.body?.error;return typeof n==`string`&&n.length>0?n:e.status===0?`${t} (transport unreachable)`:`${t} (HTTP ${e.status})`}function y(e){return e.status===0?void 0:e.status}function b(e,t,n,r){return u(e,t,v(n,r),y(n))}async function x(e,t){let n=await e.callJson(`GET`,f.secretsMasked);return n.ok?Array.isArray(n.body)?{ok:!0,value:n.body}:u(`secrets`,t,`masked secrets response is not an array`):b(`secrets`,t,n,`masked secrets request failed`)}function S(e){return{async listMaskedEnv(){let t=await x(e,`listMaskedEnv`);return t.ok?{ok:!0,value:{entries:t.value}}:t},async getMasked(t){let n=await x(e,`getMasked`);if(!n.ok)return n;let r=n.value.find(e=>e.name===t.name);return r?{ok:!0,value:r}:u(`secrets`,`getMasked`,`no secret named "${t.name}"`,404)},async set(t){let n=t.scope===`persisted`,r=n?f.secretsPersisted:f.secretsSession,i=await e.callJson(`POST`,r,{name:t.name,value:t.value,domains:[...t.domains??[]]});return n&&i.status===404?c(`secrets`,`set`,`this server has no persisted-secret write route (upgrade it; the route shipped in #2823), retry with scope: 'session'`):i.ok?{ok:!0,value:void 0}:b(`secrets`,`set`,i,`set secret failed`)},async delete(t){let n=await e.callJson(`DELETE`,`${f.secretsPersisted}/${encodeURIComponent(t.name)}`);if(!n.ok)return b(`secrets`,`delete`,n,`delete secret failed`);let r=n.body;return{ok:!0,value:{removed:r?.removed??!0,fromSession:r?.fromSession===!0}}}}}async function C(o,s){let c={method:s.method??`GET`,headers:o.headers({...n(s.headers),"X-Target-URL":s.url}),cache:`no-store`};s.signal&&(c.signal=s.signal);let l=p(s);if(l!==void 0){if(l.byteLength>33554432)return u(`network`,`crossOriginFetch`,`request body is ${l.byteLength} bytes, over the ${a}-byte proxy limit`);c.body=l}let d=await o.send(f.fetchProxy,c);if(d instanceof Error)return u(`network`,`crossOriginFetch`,h(d)?`request cancelled`:d.message);if(d.headers.get(`x-proxy-error`)===`1`){let e=await d.text().catch(()=>``);return u(`network`,`crossOriginFetch`,e||`fetch-proxy reported an error`,d.status)}let m=r(),g=Number(d.headers.get(`content-length`)??``);if(Number.isFinite(g)&&g>m)return u(`network`,`crossOriginFetch`,`response body is ${g} bytes, over the ${m}-byte download limit`,d.status);let _;try{_=new Uint8Array(await d.arrayBuffer())}catch(e){return u(`network`,`crossOriginFetch`,h(e)?`response body cancelled`:`response body failed: ${e instanceof Error?e.message:String(e)}`,d.status)}if(_.byteLength>m)return u(`network`,`crossOriginFetch`,`response body is ${_.byteLength} bytes, over the ${m}-byte download limit`,d.status);let v={};d.headers.forEach((e,t)=>{v[t]=e});let y=i(v),b=t(y[`content-type`]??``);return{ok:!0,value:{status:d.status,ok:d.ok,statusText:d.statusText,headers:y,body:b?new TextDecoder().decode(_):e(_),bodyEncoding:b?`text`:`base64`,url:s.url}}}async function w(e,t){let n=t.backend===`s3`?f.s3SignAndForward:f.daSignAndForward,r=await e.callJson(`POST`,n,t.envelope,{timeoutMs:12e4}),i=r.body;return i&&typeof i==`object`&&typeof i.ok==`boolean`?{ok:!0,value:i}:b(`mounts`,`signRequest`,r,`sign-and-forward response is not an envelope`)}async function T(e,t){let n=t.suggestedPattern??t.detail,r=await e.callJson(`POST`,f.sudoApprove,{kind:t.kind,detail:t.detail,suggestedPattern:n,...t.requester?{requester:t.requester}:{},...t.reason?{reason:t.reason}:{},...t.approver?{approver:t.approver}:{}},{humanPaced:!0,...t.signal?{signal:t.signal}:{}});return r.ok?{ok:!0,value:l(r.body,n)}:b(`approvals`,`request`,r,`approval endpoint returned non-OK`)}function E(e){let t=_(e);return{crossOriginFetch:e=>C(t,e),secrets:S(t),signRequest:e=>w(t,e),requestApproval:e=>T(t,e)}}export{E as createRestOps};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,n as t,t as n}from"./almost-bash-shell-headless-
|
|
1
|
+
import{c as e,n as t,t as n}from"./almost-bash-shell-headless-B5YFQ1wh.js";import{n as r}from"./browser-eoO4vY7w.js";import{c as i}from"./sudoers-BdBYQPUn.js";import{r as a}from"./sudo-fs-C6r_MIIY.js";import{n as o}from"./jsh-discovery-D3Gk1cKA.js";import{o as s}from"./just-bash-compat-B-SPHuh_.js";import{n as c,r as l}from"./supervisor-C1sPrIbH.js";function u(t,n){return new Map(Object.entries({HOME:e,PATH:o,USER:`user`,SHELL:`/bin/bash`,TMPDIR:`/tmp`,PWD:t.cwd,...n,...t.env}))}function d(e,t,n,i){let a=u(t,i);return r({fs:e,cwd:t.cwd,env:a,stdin:s(``),exec:(e,r)=>n.exec(e,{env:r?.env??Object.fromEntries(a),cwd:r?.cwd??t.cwd,args:r?.args,...r?.env===void 0?{}:{replaceEnv:!0}})})}const f={requestApproval:async()=>({decision:`deny`})};async function p(e){let r=h(e.fs,e.sudo),i=new t(r),a=new n({fs:r,cwd:`/workspace`,processManager:e.processManager,processOwner:{kind:`jshd`}}),o={exec:(e,t)=>a.getBash().exec(e,{env:t?.env??a.getEnv(),cwd:t?.cwd??`/workspace`,args:t?.args,...t?.env===void 0?{}:{replaceEnv:!0}})},s=c({fs:e.fs,processManager:e.processManager,lickManager:e.lickManager,...e.realmFactory?{realmFactory:e.realmFactory}:{},buildContext:e=>m(i,e,o)}),u=(await l(e.fs)).filter(e=>e.enabled);if(u.length===0)return[];let d=[];for(let e of u)try{await s.start(e),d.push(e.name)}catch{}return d}function m(e,t,n){return d(e,t,n)}function h(e,t){return a(e,{broker:t?.broker??f,getPolicy:t?.getPolicy??i,defaultDisposition:`allow`})}export{p as restoreEnabledJshdUnits};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./pdf-text-BUC5zyMg.js";function t(e,t){let n=t.lookup(e.PDFName.of(`Type`));return n===e.PDFName.of(`ObjStm`)||n===e.PDFName.of(`XRef`)}async function n(e){if(typeof CompressionStream>`u`)throw Error(`compress requires CompressionStream, unavailable in this runtime`);let t=new Blob([e]).stream().pipeThrough(new CompressionStream(`deflate`));return new Uint8Array(await new Response(t).arrayBuffer())}function r(e,t){if(!t.dict.lookup(e.PDFName.of(`Filter`)))return!1;let n;try{n=e.decodePDFRawStream(t).decode()}catch{return!1}return t.updateContents(n),t.dict.delete(e.PDFName.of(`Filter`)),t.dict.delete(e.PDFName.of(`DecodeParms`)),!0}async function i(e,t){return!t.dict.lookup(e.PDFName.of(`Filter`))&&(t.updateContents(await n(t.getContents())),t.dict.set(e.PDFName.of(`Filter`),e.PDFName.of(`FlateDecode`)),!0)}async function a(e,n,a){if(n.isEncrypted)throw Error(`cannot ${a} an encrypted PDF`);let o=0;for(let[,s]of n.context.enumerateIndirectObjects())s instanceof e.PDFRawStream&&(t(e,s.dict)||(a===`uncompress`?r(e,s):await i(e,s))&&o++);return o}function o(e){return{useObjectStreams:e!==`uncompress`}}let s=null;async function c(){return s||=import(`./es-
|
|
1
|
+
import{t as e}from"./pdf-text-BUC5zyMg.js";function t(e,t){let n=t.lookup(e.PDFName.of(`Type`));return n===e.PDFName.of(`ObjStm`)||n===e.PDFName.of(`XRef`)}async function n(e){if(typeof CompressionStream>`u`)throw Error(`compress requires CompressionStream, unavailable in this runtime`);let t=new Blob([e]).stream().pipeThrough(new CompressionStream(`deflate`));return new Uint8Array(await new Response(t).arrayBuffer())}function r(e,t){if(!t.dict.lookup(e.PDFName.of(`Filter`)))return!1;let n;try{n=e.decodePDFRawStream(t).decode()}catch{return!1}return t.updateContents(n),t.dict.delete(e.PDFName.of(`Filter`)),t.dict.delete(e.PDFName.of(`DecodeParms`)),!0}async function i(e,t){return!t.dict.lookup(e.PDFName.of(`Filter`))&&(t.updateContents(await n(t.getContents())),t.dict.set(e.PDFName.of(`Filter`),e.PDFName.of(`FlateDecode`)),!0)}async function a(e,n,a){if(n.isEncrypted)throw Error(`cannot ${a} an encrypted PDF`);let o=0;for(let[,s]of n.context.enumerateIndirectObjects())s instanceof e.PDFRawStream&&(t(e,s.dict)||(a===`uncompress`?r(e,s):await i(e,s))&&o++);return o}function o(e){return{useObjectStreams:e!==`uncompress`}}let s=null;async function c(){return s||=import(`./es-DJTRBqjm.js`),s}const l=[`dump_data`,`dump_data_utf8`,`cat`,`rotate`,`burst`],u=new Set([`uncompress`,`compress`]),d=new Set([`attach_files`,`background`,`dump_data_annots`,`dump_data_fields`,`dump_data_fields_utf8`,`fill_form`,`generate_fdf`,`multibackground`,`multistamp`,`shuffle`,`stamp`,`unpack_files`,`update_info`,`update_info_utf8`]),f=new Set([`identity`,`dump_data`,`dump_data_utf8`,`burst`]);function p(e){return l.includes(e)}function m(e){return u.has(e)}function h(e){return e.endsWith(`right`)?{range:e.slice(0,-5),rotation:90}:e.endsWith(`left`)?{range:e.slice(0,-4),rotation:270}:e.endsWith(`down`)?{range:e.slice(0,-4),rotation:180}:{range:e}}function g(e){let{range:t,rotation:n}=h(e);if(/^\d+$/.test(t)){let e=parseInt(t,10);return{start:e,end:e,rotation:n}}let r=t.match(/^(\d+)-(\d+|end)$/);if(r)return{start:parseInt(r[1],10),end:r[2]===`end`?`end`:parseInt(r[2],10),rotation:n};throw Error(`Invalid page range: ${e}`)}function _(e,t){let n=e.start,r=e.end;if(n<1||n>t)throw Error(`Page ${n} out of range (1-${t})`);let i=r===`end`?t:r;if(i<1||i>t)throw Error(`Page ${i} out of range (1-${t})`);if(i<n)throw Error(`Invalid range: ${n}-${i}`);let a=[];for(let e=n;e<=i;e++)a.push(e);return a}function v(){return{stdout:`usage: pdftk <input.pdf> [<operation> [args...]] [output <output.pdf>] [options]
|
|
2
2
|
|
|
3
3
|
Operations:
|
|
4
4
|
dump_data Print metadata (page count, title, author, etc.)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./panel-rpc-BPwAqRch.js";import{r}from"./base64-BPBW1Gzr.js";import"./bridge-protocol-31SWTdS5.js";import{n as i}from"./host-command-XUdketMY.js";import{a,i as o,n as s}from"./tool-ui-DRnUkp2g.js";import{r as c,t as l}from"./subcommand-help-CgO7wRS5.js";import{t as u}from"./approval-timeout-BQ29Z0gf.js";import{n as d}from"./screencapture-media-shared-DlK1Wqh8.js";import{a as f,o as p,s as m,t as h}from"./encode-frame-B8GkHc2t.js";import{i as g,n as _,o as ee,s as te,t as ne}from"./frames-FHlUaNCs.js";import{getComputerRegistry as re,installComputerRegistry as ie}from"./registry-Bq_j-EXx.js";import{getComputersHost as ae}from"./host-AggLcUuh.js";const oe=[`bridgeToken`,`bridge`,`tray`],se=[`cherry`,`connect`],ce=[`/join/`,`/tray/`],le=[``,`/`,`/cloud`,`/connect`];function ue(e){let t=e.replace(/\/index\.html$/,`/`);return t.length>1?t.replace(/\/$/,``):t}function de(e,t={}){let n;try{n=new URL(e)}catch{return!1}for(let e of oe)if(n.searchParams.has(e))return!0;for(let e of se)if(n.searchParams.get(e)===`1`)return!0;if(!new Set([`https://www.sliccy.ai`,`https://slicc-tray-hub-staging.minivelos.workers.dev`,...t.selfOrigins??[]]).has(n.origin))return!1;let r=ue(n.pathname);return le.includes(r)?!0:ce.some(e=>`${r}/`.startsWith(e))}function v(e={x:0,y:0}){return{x:e.x,y:e.y}}function fe(e,t){return t.x!==void 0&&t.y!==void 0&&(e.x=t.x,e.y=t.y),e}function y(e,t){return t.x!==void 0&&t.y!==void 0?(e.x=t.x,e.y=t.y,{x:t.x,y:t.y}):{x:e.x,y:e.y}}function pe(e,t){return t.map(t=>{if(t.type===`mousemove`||t.type===`click`||t.type===`button`||t.type===`scroll`){let n=y(e,t);return{...t,x:n.x,y:n.y}}return t.type===`drag`&&fe(e,{x:t.x2,y:t.y2}),t})}function me(e){return`tab:${e}`}const he={screenshot:!0,text:!1,frames:`poll`,keyboard:!0,mouse:`absolute`,scroll:!0,exec:!1,inputAllowed:!0},b={1:`left`,2:`middle`,3:`right`};function x(e){if(de(e.url))throw Error(`refusing SLICC app tab '${e.title??e.url}'`)}var ge=class{browser;targetId;seq=0;title;url;size=null;pointer=v();constructor(e,t,n={title:t,url:``}){this.browser=e,this.targetId=t,this.title=n.title,this.url=n.url}describe(){return{id:me(this.targetId),kind:`tab`,title:this.title,size:this.size,state:`live`,capabilities:he,pid:null}}async screenshot(e){return await this.refreshInfo(),x({url:this.url,title:this.title}),this.browser.withTab(this.targetId,async t=>{let n=await _e(t,e);return n.native&&(this.size=n.native),this.seq+=1,{seq:this.seq,mime:n.mime,width:n.width,height:n.height,bytes:n.bytes}})}async input(e){await this.refreshInfo(),x({url:this.url,title:this.title}),await this.browser.withTab(this.targetId,async t=>{for(let n of e)await S(t,n,this.pointer)})}async close(){}async refreshInfo(){let e=await we(this.browser,this.targetId);e&&(this.title=e.title||this.title,this.url=e.url||this.url)}};async function _e(e,t){let n=await e.screenshot({format:`png`}),r=h(n),i=m(r)??f(r),a=r;t.maxWidth&&i&&i.width>t.maxWidth?a=h(await e.screenshot({format:`png`,maxWidth:t.maxWidth})):t.format!==`png`&&(a=h(await e.screenshot({format:`jpeg`,quality:70})));let o=m(a)??f(a)??i??{width:0,height:0};return t.format!==`png`&&!f(a)&&(a=await p(a)),{mime:f(a)?`image/jpeg`:`image/png`,bytes:a,width:o.width,height:o.height,native:i}}var ve=class{rpc;targetId;seq=0;title;url;size=null;pointer=v();constructor(e,t,n={title:t,url:``}){this.rpc=e,this.targetId=t,this.title=n.title,this.url=n.url}describe(){return{id:me(this.targetId),kind:`tab`,title:this.title,size:this.size,state:`live`,capabilities:he,pid:null}}async screenshot(e){let t=await this.rpc.call(`computer-tab-screenshot`,{targetId:this.targetId,maxWidth:e.maxWidth,format:e.format});return this.title=t.title,this.url=t.url,this.size=t.nativeWidth&&t.nativeHeight?{width:t.nativeWidth,height:t.nativeHeight}:{width:t.width,height:t.height},this.seq+=1,{seq:this.seq,mime:t.mime,width:t.width,height:t.height,bytes:h(t.base64)}}async input(e){let t=pe(this.pointer,e);await this.rpc.call(`computer-tab-input`,{targetId:this.targetId,events:t})}async close(){}};async function S(e,t,n=v()){switch(t.type){case`mousemove`:{let r=y(n,t);await e.send(`Input.dispatchMouseEvent`,{type:`mouseMoved`,x:r.x,y:r.y});return}case`button`:await ye(e,t,n);return;case`click`:await be(e,t,n);return;case`drag`:await xe(e,t,n);return;case`scroll`:{let r=y(n,t);await e.send(`Input.dispatchMouseEvent`,{type:`mouseWheel`,x:r.x,y:r.y,deltaX:t.dx,deltaY:t.dy});return}case`key`:await Se(e,t);return;case`text`:await e.send(`Input.insertText`,{text:t.text});return;case`wait`:await C(Math.max(0,t.ms));return}}async function ye(e,t,n){let r=y(n,t);await e.send(`Input.dispatchMouseEvent`,{type:t.down?`mousePressed`:`mouseReleased`,x:r.x,y:r.y,button:b[t.button],clickCount:1})}async function be(e,t,n){let r=y(n,t),i=Math.max(1,t.count);for(let n=1;n<=i;n++)await e.send(`Input.dispatchMouseEvent`,{type:`mousePressed`,x:r.x,y:r.y,button:b[t.button],clickCount:n}),t.holdMs&&t.holdMs>0&&await C(t.holdMs),await e.send(`Input.dispatchMouseEvent`,{type:`mouseReleased`,x:r.x,y:r.y,button:b[t.button],clickCount:n})}async function xe(e,t,n){await S(e,{type:`mousemove`,x:t.x1,y:t.y1},n),await S(e,{type:`button`,button:1,down:!0,x:t.x1,y:t.y1},n),await S(e,{type:`mousemove`,x:t.x2,y:t.y2},n),await S(e,{type:`button`,button:1,down:!1,x:t.x2,y:t.y2},n)}async function Se(e,t){let n=ee(t.keysym);if(!n)throw Error(`unknown keysym '${t.keysym}'`);for(let r of te(n,t.down))await e.send(`Input.dispatchKeyEvent`,{type:r.type,key:r.key,code:r.code,modifiers:r.modifiers,...r.text===void 0?{}:{text:r.text}})}function Ce(e,t){let n=e.find(e=>e.targetId===t);if(n)return n;let r=e.filter(e=>e.url===t||e.url.startsWith(t));if(r.length===1)return r[0];if(r.length>1)return{error:`ambiguous url '${t}' matches ${r.length} tabs`};let i=e.filter(e=>e.title===t);return i.length===1?i[0]:{error:`no tab matching '${t}'`}}async function we(e,t){let n=(await e.listAllTargets()).find(e=>e.targetId===t);return n?{title:n.title,url:n.url}:null}function C(e){return new Promise(t=>setTimeout(t,e))}function Te(e,t){for(let n of t){let t=Ee(e,n);if(t)return t}return null}function Ee(e,t){return t.type===`wait`?null:e.inputAllowed?t.type===`key`||t.type===`text`?e.keyboard?null:`keyboard input is not supported`:t.type===`scroll`?e.scroll?null:`scroll is not supported`:(t.type===`mousemove`||t.type===`button`||t.type===`click`||t.type===`drag`)&&e.mouse===`none`?`mouse input is not supported`:null:`input is not allowed`}const w={low:256,medium:768,high:1536};function T(e){if(!e)return w.medium;if(e in w)return w[e];let t=/^(\d+)(?:x\d+)?$/u.exec(e);if(t){let e=Number.parseInt(t[1],10);if(e>0)return e}return w.medium}function E(e,t){let n=e.width>0?e.width:t.width,r=e.height>0?e.height:t.height,i=t.width,a=t.height,o=n>0?i/n:1;return{nativeWidth:n,nativeHeight:r,shotWidth:i,shotHeight:a,scale:o>0?o:1}}function De(e){let t=e.scale===1?`1`:e.scale.toFixed(2).replace(/0+$/u,``).replace(/\.$/u,``);return`${e.nativeWidth}x${e.nativeHeight} → ${e.shotWidth}x${e.shotHeight} (scale ${t})`}function D(e,t){return{width:e.shotWidth,height:e.shotHeight,scale:e.scale,at:t}}function Oe(e,t,n,r){return r||!n||n.scale===0?{x:e,y:t}:{x:Math.round(e/n.scale),y:Math.round(t/n.scale)}}const O=`computer — look at and poke a screen (xdotool grammar)
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
computer [-c <id>] [--json] [--native] <verb> [args] [verb ...]
|
|
5
|
+
|
|
6
|
+
Target: -c / --computer, else $COMPUTER, else last \`computer use\`, else
|
|
7
|
+
the only registered computer. \`computer ls\` lists ids.
|
|
8
|
+
|
|
9
|
+
Lifecycle:
|
|
10
|
+
ls list registered computers
|
|
11
|
+
add tab <targetId|url> [-n name]
|
|
12
|
+
register a browser tab (refuses SLICC app tabs)
|
|
13
|
+
add screen [-n name] share this display (needs a user gesture)
|
|
14
|
+
add ssh <follower> [--sim <udid>] [--allow-input] [-n name]
|
|
15
|
+
follower desktop (or iOS Simulator on a Mac).
|
|
16
|
+
--allow-input needs sudo (phone can Face ID).
|
|
17
|
+
The iOS follower itself is never a computer.
|
|
18
|
+
add url <http(s)://base> [-n name]
|
|
19
|
+
HTTP remote computer (GET /computer). Trailing
|
|
20
|
+
/computer is stripped. node-server --computer-demo
|
|
21
|
+
is the in-tree reference.
|
|
22
|
+
rm [id] unregister (stops a live screen share)
|
|
23
|
+
use <id> set the default computer
|
|
24
|
+
info descriptor for the current target
|
|
25
|
+
|
|
26
|
+
Look:
|
|
27
|
+
screenshot [--size low|medium|high|<N>] [--view] [file]
|
|
28
|
+
JPEG; prints WxH → wxh (scale s) and a frozen frame
|
|
29
|
+
text text-mode dump when the backend supports it
|
|
30
|
+
watch [--fps N] [--stop] live frames to the page (phase 2 UI)
|
|
31
|
+
record [-V|--duration SEC] [file]
|
|
32
|
+
timed clip from a live screen session (other kinds: phase 4)
|
|
33
|
+
|
|
34
|
+
Poke (xdotool; every verb ends with a frozen-frame line):
|
|
35
|
+
mousemove <x> <y> [--relative]
|
|
36
|
+
click [1|2|3] [--at x,y] [--hold MS] [--repeat N]
|
|
37
|
+
mousedown [1|2|3] [--at x,y]
|
|
38
|
+
mouseup [1|2|3] [--at x,y]
|
|
39
|
+
drag <x1> <y1> <x2> <y2>
|
|
40
|
+
scroll <dx> <dy> [--at x,y]
|
|
41
|
+
key <keysym> [keysym...] ctrl+alt+Delete, Return, F5, super+space
|
|
42
|
+
keydown <keysym>
|
|
43
|
+
keyup <keysym>
|
|
44
|
+
type <text...>
|
|
45
|
+
wait <ms>
|
|
46
|
+
exec <command...> when the backend supports it
|
|
47
|
+
|
|
48
|
+
Anthropic aliases (same verbs):
|
|
49
|
+
left_click right_click middle_click double_click triple_click
|
|
50
|
+
left_click_drag mouse_move scroll key type screenshot wait
|
|
51
|
+
|
|
52
|
+
Coordinates are screenshot-space of the last shot unless --native.
|
|
53
|
+
Buttons: 1 left, 2 middle, 3 right. Chain verbs: computer click 1 type hello
|
|
54
|
+
|
|
55
|
+
v86 guests register as v86:<name> on \`v86 start\`. Prefer this command;
|
|
56
|
+
\`v86 type|key|mouse|screenshot|text\` remain as thin aliases.
|
|
57
|
+
`,ke=[`-c`,`--computer`,`--size`,`--at`,`--hold`,`--repeat`,`--fps`,`-n`,`--name`,`--__resolved`,`-V`,`--duration`,`--sim`],k=new Set([`ls`,`add`,`rm`,`use`,`info`,`screenshot`,`text`,`watch`,`record`,`mousemove`,`click`,`mousedown`,`mouseup`,`drag`,`scroll`,`key`,`keydown`,`keyup`,`type`,`wait`,`exec`]),A={left_click:`click`,right_click:`click`,middle_click:`click`,double_click:`click`,triple_click:`click`,left_click_drag:`drag`,mouse_move:`mousemove`,screenshot:`screenshot`,wait:`wait`,key:`key`,type:`type`,scroll:`scroll`},Ae=new Set([`type`,`key`,`exec`,`add`]),j=new Set([`--size`,`--at`,`--hold`,`--repeat`,`--fps`,`-n`,`--name`,`-c`,`--computer`,`--__resolved`,`-V`,`--duration`,`--sim`]);function M(e){return k.has(e)||e in A}function je(e){return k.has(e)?e:A[e]??null}function Me(e){let t=[],n,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a];if(o===`--`){t.push(...e.slice(a));break}if(o===`--json`){r=!0;continue}if(o===`--native`){i=!0;continue}if(o===`-c`||o===`--computer`){n=e[++a];continue}t.push(o)}return{computer:n,json:r,native:i,rest:t}}function Ne(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`--`){n+=1;continue}let i=je(r);if(!i)throw Error(`unknown verb '${r}' — see \`computer --help\``);n+=1;let{args:a,next:o}=Fe(i,e,n);t.push({verb:i,alias:r,args:Pe(r,i,a)}),n=o}return t}function Pe(e,t,n){return t===`click`?e===`left_click`?N(n,`1`):e===`middle_click`?N(n,`2`):e===`right_click`?N(n,`3`):e===`double_click`?[...N(n,`1`),`--repeat`,`2`]:e===`triple_click`?[...N(n,`1`),`--repeat`,`3`]:n:n}function N(e,t){return e[0]===`1`||e[0]===`2`||e[0]===`3`?e:[t,...e]}function Fe(e,t,n){return Ae.has(e)?Ie(t,n):Le(ze(e),t,n)}function Ie(e,t){let n=[],r=t,i=!1;for(;r<e.length;){let t=e[r];if(!i&&t===`--`){i=!0,r+=1;continue}if(!i&&M(t))break;n.push(t),r+=1}return{args:n,next:r}}function P(e){return e.startsWith(`--`)||e===`-n`||e===`-c`||e===`-V`}function F(e,t,n){let r=e[t];return n.push(r),t+=1,j.has(r)&&t<e.length&&(n.push(e[t]),t+=1),t}function Le(e,t,n){let r=[],i=n,a=0;for(;i<t.length;){let n=t[i];if(n===`--`){i+=1;continue}if(P(n)){i=F(t,i,r);continue}if(M(n))break;if(r.push(n),a+=1,i+=1,a>=e&&e>0){i=Re(t,i,r);break}}return{args:r,next:i}}function Re(e,t,n){let r=t;for(;r<e.length&&P(e[r]);)r=F(e,r,n);return r}function ze(e){switch(e){case`mousemove`:return 2;case`drag`:return 4;case`scroll`:return 2;case`click`:case`mousedown`:case`mouseup`:return 3;case`wait`:case`keydown`:case`keyup`:case`rm`:case`use`:return 1;case`screenshot`:return 1;case`record`:return 1;default:return 0}}function I(e){let t=e.indexOf(`--at`);if(t===-1)return;let n=e[t+1],r=n?/^(-?\d+),(-?\d+)$/u.exec(n):null;if(!r)throw Error(`--at requires x,y`);return{x:Number(r[1]),y:Number(r[2])}}function L(e,t){let n=e.indexOf(t);if(n===-1)return;let r=Number.parseInt(e[n+1]??``,10);if(!Number.isFinite(r))throw Error(`${t} requires a number`);return r}function R(e,t){return e.includes(t)}function z(e,t){for(let n of t){let t=e.indexOf(n);if(t!==-1)return e[t+1]}}function B(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r===`--`){t.push(...e.slice(n+1));break}if(r.startsWith(`--`)||r===`-n`||r===`-c`||r===`-V`){j.has(r)&&(n+=1);continue}t.push(r)}return t}const V=new Set;let H;function Be(e){if(typeof e!=`object`||!e)return!1;let t=Object.getOwnPropertyDescriptor(e,`type`)?.value,n=Object.getOwnPropertyDescriptor(e,`id`)?.value;return(t===`begin`||t===`end`)&&typeof n==`string`}function U(e){e.type===`begin`?V.add(e.id):V.delete(e.id)}function Ve(){if(H===void 0){if(typeof BroadcastChannel!=`function`){H=null;return}try{H=new BroadcastChannel(`slicc-screen-share-approval`)}catch{H=null;return}H.onmessage=e=>{Be(e.data)&&U(e.data)}}}function W(e){Ve(),U(e);try{H?.postMessage(e)}catch{}}function He(e){W({type:`begin`,id:e})}function Ue(e){W({type:`end`,id:e})}const G=Symbol(`screen-share-approval-timeout`);function We(){return`
|
|
58
|
+
<div class="sprinkle-action-card">
|
|
59
|
+
<div class="sprinkle-action-card__header">
|
|
60
|
+
<div class="sprinkle-action-card__title-group">Share this display</div>
|
|
61
|
+
<span class="sprinkle-badge sprinkle-badge--notice">approval</span>
|
|
62
|
+
</div>
|
|
63
|
+
<div class="sprinkle-action-card__actions">
|
|
64
|
+
<button class="sprinkle-btn sprinkle-btn--secondary" data-action="deny">Deny</button>
|
|
65
|
+
<button class="sprinkle-btn sprinkle-btn--primary" data-action="approve" data-picker="screenshare">Share screen</button>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
`}async function Ge(){let e=a();if(!e)throw Error("add screen: needs a user gesture — type `computer add screen` in the panel terminal, or run it from a cone tool call so an approval card can open the picker");let t=o.generateId(),n=!1;He(t);try{let r=s({id:t,html:We(),onAction:async(e,t)=>{if(e!==`approve`)return{denied:!0};let n=t;return n?.cancelled?{cancelled:!0}:n?.error?{error:String(n.error)}:n?.granted&&typeof n.handle==`string`?{approved:!0,handle:n.handle}:{error:`screen share returned an unexpected response`}}},e.onUpdate).catch(e=>{if(n)return G;throw e}),i,a=new Promise(e=>{i=setTimeout(()=>{n=!0,o.cancel(t,`screen share: timed out`),e(G)},12e4)}),c=await Promise.race([r,a]);if(i&&clearTimeout(i),c===G)throw Error(`add screen: timed out after 120s waiting for user approval`);let l=c;if(l.denied)throw Error(`add screen: denied by user`);if(l.cancelled)throw Error(`add screen: cancelled`);if(l.error)throw Error(`add screen: ${l.error}`);if(!l.approved||!l.handle)throw Error(`add screen: no display selected`);return{handle:l.handle}}finally{Ue(t)}}function K(e,t,n){let r=e.list();if(t)return Ke(r,t);let i=n.get(`COMPUTER`);if(i)return Ke(r,i);let a=e.lastUsedId();return a&&e.get(a)?{id:a}:r.length===1?{id:r[0].id}:r.length===0?{error:"no computers registered — `computer add tab <id>`, `computer add screen`, `computer add ssh <follower>`, `computer add url <http(s)://base>`, or `v86 start`"}:{error:`which computer? pass -c <id> or \`computer use\`. registered: ${r.map(e=>e.id).join(`, `)}`}}function Ke(e,t){let n=e.find(e=>e.id===t);if(n)return{id:n.id};let r=e.filter(e=>e.id.endsWith(`:${t}`)||e.title===t||e.id===`v86:${t}`||e.id===`tab:${t}`||e.id===`screen:${t}`||e.id===`ssh:${t}`||e.id===`url:${t}`);if(r.length===1)return{id:r[0].id};if(r.length>1)return{error:`ambiguous computer '${t}' matches ${r.map(e=>e.id).join(`, `)}`};let i=e.map(e=>e.id).join(`, `);return{error:`unknown computer '${t}'${i?` — registered: ${i}`:` — none registered`}`}}var qe=e({runComputer:()=>nt});function q(e){return{stdout:``,stderr:`computer: ${e}\n`,exitCode:1}}function J(e=``){return{stdout:e,stderr:``,exitCode:0}}function Je(){return globalThis.__slicc_pm??null}function Ye(e){return e.browser??globalThis.__slicc_browser??null}function Y(e){return e.panelRpc??globalThis.__slicc_panelRpc??t()}function Xe(e){return e.sudoBroker?e.sudoBroker:globalThis.__slicc_sudo??null}function Ze(e){return e.listFollowers?.()??i()}async function Qe(e,t,r,i){if(e.sshExec)return e.sshExec(t,r,i);let a=Y(e);if(!a)throw Error(`no panel RPC in this float`);let o=i??3e4,s=await a.call(`tray-exec`,{runtimeId:t,command:r,execToken:`computer-ssh-${Date.now().toString(36)}`,timeoutMs:o},{timeoutMs:o+n});if(s.error)throw Error(s.error);return{stdout:s.stdout,stderr:s.stderr,exitCode:s.exitCode}}function $e(e,t){let n=t.filter(e=>e.exec),r=n.find(t=>t.runtimeId===e);if(r)return r;let i=n.filter(t=>t.runtimeId.endsWith(e)||t.runtimeId.includes(e));return i.length===1?i[0]:i.length>1?{error:`add ssh: ambiguous follower '${e}'`}:{error:`add ssh: no exec-capable follower '${e}' — try \`ssh --list\``}}function et(e){let t=[];return e.kind===`screen`&&t.push(`display slot`),e.kind===`ssh`&&t.push(e.capabilities.inputAllowed?`input`:`view-only`),t.length>0?` [${t.join(`, `)}]`:``}function tt(e){return e.registry?e.registry:re()??ie(e.processManager??Je())}async function nt(e,t,n={}){if(e.length===0||e[0]===`--help`||e[0]===`-h`||e[0]===`help`)return J(O);let r=Me(e);if(r.rest.length===0)return J(O);let i=r.rest[0];if(l(r.rest.slice(1),{valueFlags:[...ke]}))return J(c(`computer`,i,O,{prefix:`computer`}));let a;try{a=Ne(r.rest)}catch(e){return q(e instanceof Error?e.message:String(e))}let o=tt(n),s=[];for(let e of a)try{let i=await rt(e,r,t,n,o);if(i.exitCode!==0)return i;i.stdout&&s.push(i.stdout.replace(/\n$/u,``))}catch(e){return q(e instanceof Error?e.message:String(e))}let u=Lt(s.filter(Boolean).join(`
|
|
69
|
+
`),a,o,r.computer,t,r.json);return J(u?`${u}\n`:``)}async function rt(e,t,n,r,i){switch(e.verb){case`ls`:return it(i,t.json);case`add`:return at(e.args,n,r,i);case`rm`:return dt(e.args,t.computer,n,i);case`use`:return ft(e.args,i);case`info`:return pt(t,n,i);case`screenshot`:return mt(e.args,t,n,i);case`text`:return ht(t,n,i);case`watch`:return gt(e.args,t,n,i,r);case`record`:return yt(e.args,t,n,i);case`exec`:return xt(e.args,t,n,i);default:return St(e,t,n,i)}}function it(e,t){let n=e.list();if(t)return J(`${JSON.stringify(n)}\n`);if(n.length===0)return J(`no computers registered
|
|
70
|
+
`);let r=[`ID KIND STATE TITLE`];for(let e of n)r.push(`${e.id.padEnd(20)} ${e.kind.padEnd(6)} ${e.state.padEnd(9)} ${e.title}${et(e)}`);return J(`${r.join(`
|
|
71
|
+
`)}\n`)}async function at(e,t,n,r){let i=e[0];return i===`tab`?lt(e,t,n,r):i===`screen`?ut(e,t,n,r):i===`ssh`?ct(e,t,n,r):i===`url`?st(e,t,n,r):q(`add: unknown kind '${i??``}' — phase 3 supports \`computer add tab\`, \`computer add screen\`, \`computer add ssh\`, and \`computer add url\``)}async function ot(e){if(e.urlFetch)return e.urlFetch;let{createProxiedFetch:t}=await import(`./proxied-fetch-CPL8wJM2.js`).then(e=>e.i),{wrapUrlComputerFetch:n}=await import(`./url-Dq7PTmNp.js`),r=t();return n((e,t)=>r(e,t))}async function st(e,t,n,r){let i=z(e,[`-n`,`--name`]),a=B(e).slice(1)[0];if(!a)return q(`add url: requires <http(s)://base>`);let{UrlComputerBackend:o,probeUrlComputer:s,normalizeComputerBase:c}=await import(`./url-Dq7PTmNp.js`),l;try{l=c(a)}catch(e){return q(`add url: ${e instanceof Error?e.message:String(e)}`)}let u=await ot(n),d;try{d=await s(u,l)}catch(e){let t=e instanceof Error?e.message:String(e);return q(t.startsWith(`add url:`)?t:`add url: ${t}`)}i&&(d={...d,title:i});let f=new o(u,l,d),p=r.register(f);return r.use(p.id),J(`registered ${p.id} (${p.title})\n`)}async function ct(e,t,n,r){let i=z(e,[`-n`,`--name`]),a=z(e,[`--sim`]),o=R(e,`--allow-input`),s=B(e).slice(1)[0];if(!s)return q(`add ssh: requires <follower>`);let c=$e(s,Ze(n));if(`error`in c)return q(c.error);if(c.floatType===`ios`)return q(`add ssh: the iOS follower itself is not a driven computer (a real iPhone is out of scope; pass --sim <udid> on a Mac follower)`);let{SshComputerBackend:l,probeSsh:d}=await import(`./ssh-BQqlQVXQ.js`),f=(e,t)=>Qe(n,c.runtimeId,e,t?.timeoutMs),p;try{p=await d(f,a)}catch(e){let t=e instanceof Error?e.message:String(e);return q(t.startsWith(`add ssh:`)?t:`add ssh: ${t}`)}if(o&&p.input===`none`)return q(`add ssh: --allow-input needs cliclick, xdotool, ydotool, or idb on the follower (screenshot-only otherwise)`);if(o){let e=Xe(n);if(!e)return q(`add ssh: --allow-input needs sudo approval (not configured)`);let t=await e.requestApproval({kind:`command`,detail:`computer add ssh ${c.runtimeId}${a?` --sim ${a}`:``} --allow-input`,reason:`grant pointer and keyboard control of the follower desktop`});if(t.decision===`deny`)return q(u(`add ssh`,t))}let m=i??(a?`${c.runtimeId} sim ${a}`:c.runtimeId),h=new l(f,{runtimeId:c.runtimeId,title:m,probe:p,inputAllowed:o,sim:a}),g=r.register(h);return r.use(g.id),J(`registered ${g.id} (${g.title})\n`)}async function lt(e,t,n,r){let i=z(e,[`-n`,`--name`]),a=B(e).slice(1)[0];if(!a)return q(`add tab: requires <targetId|url>`);let o=Ye(n);if(!o)return q(`add tab: no browser API in this float`);let s=Ce(await o.listAllTargets(),a);if(`error`in s)return q(s.error);try{x(s)}catch(e){return q(e instanceof Error?e.message:String(e))}let c={title:i??s.title,url:s.url},l=n.browser&&!n.panelRpc?null:Y(n),u=l?new ve(l,s.targetId,c):new ge(o,s.targetId,c),d=r.register(u);return r.use(d.id),J(`registered ${d.id} (${d.title})\n`)}async function ut(e,t,n,r){let i=z(e,[`-n`,`--name`]),o=z(e,[`--__resolved`]);if(!o){if(!a())return q("add screen: needs a user gesture — type `computer add screen` in the panel terminal, or run it from a cone tool call so an approval card can open the picker");try{o=(await Ge()).handle}catch(e){return q(e instanceof Error?e.message:String(e))}}let s=Y(n);if(!s)return q(`add screen: no panel RPC in this float`);let{BridgedScreenComputerBackend:c,screenComputerId:l}=await import(`./screen-s6LdF1JP.js`),u=new c(s,o,{title:i??`Display`},()=>{r.refresh(l(o))}),d=r.register(u);return r.use(d.id),J(`registered ${d.id} (${d.title})\n`)}async function dt(e,t,n,r){let i=K(r,B(e)[0]??t,Q(n));return`error`in i?q(i.error):await r.unregister(i.id)?J(`unregistered ${i.id}\n`):q(`unknown computer '${i.id}'`)}function ft(e,t){let n=B(e)[0];if(!n)return q(`use: requires <id>`);let r=K(t,n,new Map);return`error`in r?q(r.error):(t.use(r.id),J(`using ${r.id}\n`))}function pt(e,t,n){let r=K(n,e.computer,Q(t));if(`error`in r)return q(r.error);let i=n.getEntry(r.id);if(!i)return q(`unknown computer '${r.id}'`);if(e.json)return J(`${JSON.stringify(i.descriptor)}\n`);let a=i.descriptor,o=a.size?`${a.size.width}x${a.size.height}`:`-`;return J(`id: ${a.id}\nkind: ${a.kind}\ntitle: ${a.title}\nstate: ${a.state}\nsize: ${o}\npid: ${a.pid??`-`}\n`)}async function mt(e,t,n,i){let a=Z(i,t.computer,n);if(`exitCode`in a)return a;let o=T(z(e,[`--size`])),s=await a.backend.screenshot({format:`jpeg`,maxWidth:o}),c=E(a.backend.describe().size??{width:s.width,height:s.height},{width:s.width,height:s.height});i.rememberShot(a.id,D(c,Date.now()),s);let l=s.seq>0?s.seq:i.nextSeq(a.id),u=await g({fs:n.fs,cwd:n.cwd,env:n.env,name:$(a.descriptor),seq:l,frame:s}),d=B(e)[0];if(d){let e=n.fs.resolvePath(n.cwd,d);await n.fs.writeFile(e,s.bytes)}let f=[De(c),_(u)];return(R(e,`--view`)||R(e,`-v`))&&f.push(`<img:data:${s.mime};base64,${r(s.bytes)}>`),t.json?J(`${JSON.stringify({id:a.id,path:u,mapping:c})}\n`):J(`${f.join(`
|
|
72
|
+
`)}\n`)}async function ht(e,t,n){let r=Z(n,e.computer,t);if(`exitCode`in r)return r;if(!r.backend.text)return q(`text: '${r.id}' has no text dump`);let i=await r.backend.text();return i===null?q(`text: unavailable for '${r.id}'`):J(`${i}\n`)}async function gt(e,t,n,r,i){let a=Z(r,t.computer,n);if(`exitCode`in a)return a;let o=bt(i);if(!o)return q(`watch: computers host is not running`);if(R(e,`--stop`))return o.unwatch(a.id),J(`unwatched ${a.id}\n`);let s=L(e,`--fps`)??2,c=T(z(e,[`--size`]));return o.watch(a.id,s,c),J(`watching ${a.id} at ${s} fps\n`)}function _t(e){return`recordClip`in e&&typeof e.recordClip==`function`}function vt(e){let t=z(e,[`-V`,`--duration`]);if(t===void 0)return 5;let n=Number(t);if(!Number.isFinite(n)||n<=0)throw Error(`-V/--duration requires a positive number of seconds`);return n}async function yt(e,t,n,r){let i=Z(r,t.computer,n);if(`exitCode`in i)return i;let a=i.descriptor.kind;if(a!==`screen`||!_t(i.backend))return q(`record: not supported for '${a}' yet (phase 4)`);let o;try{o=vt(e)}catch(e){return q(e instanceof Error?e.message:String(e))}let s=d(o*1e3),c=await i.backend.recordClip(s),l=B(e)[0]??`clip.webm`,u=n.fs.resolvePath(n.cwd,l);await n.fs.writeFile(u,c.bytes);let f=c.durationMs??s;return t.json?J(`${JSON.stringify({id:i.id,path:u,durationMs:f,mime:c.mime})}\n`):J(`recorded ${f}ms ${c.width}x${c.height} → ${u}\n`)}function bt(e){if(e.watch)return{watch:e.watch,unwatch:e.unwatch??(()=>void 0)};let t=ae();return t?{watch:t.watch,unwatch:t.unwatch}:null}async function xt(e,t,n,r){let i=Z(r,t.computer,n);if(`exitCode`in i)return i;if(!i.backend.exec)return q(`exec: '${i.id}' does not support exec`);let a=e.join(` `);if(!a)return q(`exec: requires a command`);let o=await i.backend.exec(a),s=[o.stdout,o.stderr].filter(Boolean).join(`
|
|
73
|
+
`);return{stdout:s?`${s}\n`:``,stderr:``,exitCode:o.exitCode}}async function St(e,t,n,r){let i=Z(r,t.computer,n);if(`exitCode`in i)return i;let a=Tt(e,t.native,i.descriptor),o=Te(i.descriptor.capabilities,a);return o?q(`${e.verb}: ${o}`):(await i.backend.input(a),Ct(i,n,r))}async function Ct(e,t,n){let r=e.descriptor.lastShot?.width??768,i=new AbortController,a;try{a=await wt(e.backend.screenshot({format:`jpeg`,maxWidth:r,signal:i.signal}),5e3)}catch(e){return i.abort(),q(`screenshot failed after input: ${e instanceof Error?e.message:String(e)}`)}let o=E(e.backend.describe().size??{width:a.width,height:a.height},{width:a.width,height:a.height}),s=n.nextSeq(e.id),c={...a,seq:s};n.rememberShot(e.id,D(o,Date.now()),c);let l=await g({fs:t.fs,cwd:t.cwd,env:t.env,name:$(e.descriptor),seq:s,frame:c});return J(`${_(l)}\n`)}function wt(e,t){return new Promise((n,r)=>{let i=setTimeout(()=>r(Error(`timed out`)),t);e.then(e=>{clearTimeout(i),n(e)},e=>{clearTimeout(i),r(e)})})}function Tt(e,t,n){let r=(e,r)=>Oe(e,r,n.lastShot,t);switch(e.verb){case`mousemove`:return Et(e.args,r);case`click`:case`mousedown`:case`mouseup`:return Dt(e.verb,e.args,r);case`drag`:return Ot(e.args,r,n.capabilities.mouse);case`scroll`:return kt(e.args,r);case`key`:case`keydown`:case`keyup`:return At(e.verb,e.args);case`type`:return jt(e.args);case`wait`:return Mt(e.args);default:throw Error(`internal: ${e.verb} is not an input verb`)}}function Et(e,t){let n=B(e),r=Number(n[0]),i=Number(n[1]);if(!Number.isFinite(r)||!Number.isFinite(i))throw Error(`mousemove: requires <x> <y>`);let a=R(e,`--relative`),o=a?{x:r,y:i}:t(r,i);return[{type:`mousemove`,x:o.x,y:o.y,relative:a}]}function Dt(e,t,n){let r=B(t),{button:i,skip:a}=Nt(r),o=I(t)??Ft(r,a),s=o?n(o.x,o.y):void 0;if(e===`mousedown`)return[{type:`button`,button:i,down:!0,...X(s)}];if(e===`mouseup`)return[{type:`button`,button:i,down:!1,...X(s)}];let c=L(t,`--hold`);return[{type:`click`,button:i,count:L(t,`--repeat`)??1,...c===void 0?{}:{holdMs:c},...X(s)}]}function Ot(e,t,n){let r=B(e).map(Number);if(r.length<4||r.some(e=>!Number.isFinite(e)))throw Error(`drag: requires <x1> <y1> <x2> <y2>`);let i=t(r[0],r[1]),a=t(r[2],r[3]);return n===`touch`?[{type:`drag`,x1:i.x,y1:i.y,x2:a.x,y2:a.y}]:[{type:`mousemove`,x:i.x,y:i.y},{type:`button`,button:1,down:!0,x:i.x,y:i.y},{type:`mousemove`,x:a.x,y:a.y},{type:`button`,button:1,down:!1,x:a.x,y:a.y}]}function kt(e,t){let n=B(e),r=Number(n[0]),i=Number(n[1]);if(!Number.isFinite(r)||!Number.isFinite(i))throw Error(`scroll: requires <dx> <dy>`);let a=I(e);return[{type:`scroll`,dx:r,dy:i,...X(a?t(a.x,a.y):void 0)}]}function At(e,t){if(e===`key`){if(t.length===0)throw Error(`key: no keysym supplied`);return t.map(e=>({type:`key`,keysym:e}))}let n=B(t)[0];if(!n)throw Error(`${e}: no keysym supplied`);return[{type:`key`,keysym:n,down:e===`keydown`}]}function jt(e){let t=e.join(` `).replace(/\\n/gu,`
|
|
74
|
+
`).replace(/\\t/gu,` `);if(!t)throw Error(`type: no text supplied`);return[{type:`text`,text:t}]}function Mt(e){let t=Number(B(e)[0]);if(!Number.isFinite(t))throw Error(`wait: requires <ms>`);return[{type:`wait`,ms:t}]}function Nt(e){return e[0]===void 0?{button:1,skip:0}:e[0]===`left`||e[0]===`middle`||e[0]===`right`||e[0]===`1`||e[0]===`2`||e[0]===`3`?{button:Pt(e[0]),skip:1}:{button:1,skip:0}}function Pt(e){if(!e||e===`left`||e===`1`)return 1;if(e===`middle`||e===`2`)return 2;if(e===`right`||e===`3`)return 3;let t=Number.parseInt(e,10);if(t===1||t===2||t===3)return t;throw Error(`unknown button '${e}' (use 1|2|3)`)}function Ft(e,t){let n=Number(e[t]),r=Number(e[t+1]);if(Number.isFinite(n)&&Number.isFinite(r))return{x:n,y:r}}function X(e){return e?{x:e.x,y:e.y}:{}}const It=new Set([`ls`,`add`,`rm`,`use`]);function Lt(e,t,n,r,i,a){if(a||!t.some(e=>!It.has(e.verb)))return e;let o=K(n,r,Q(i));if(`error`in o)return e;let s=ne(o.id);return e.split(`
|
|
75
|
+
`).some(e=>e.trim()===s)?e:e?`${s}\n${e}`:s}function Z(e,t,n){let r=K(e,t,Q(n));if(`error`in r)return q(r.error);let i=e.getEntry(r.id);return i?{id:r.id,backend:i.backend,descriptor:i.descriptor}:q(`unknown computer '${r.id}'`)}function Q(e){let t=e.env;if(t instanceof Map)return t;let n=new Map;if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))r!==void 0&&n.set(e,r);return n}function $(e){return e.id.replace(/[/:]/gu,`_`)}export{pe as n,v as r,nt as runComputer,qe as t};
|
|
@@ -92,7 +92,7 @@ Examples:
|
|
|
92
92
|
--authorize-url 'https://auth.x.ai/oauth2/auth?...' \\
|
|
93
93
|
--redirect-pattern 'http://127.0.0.1:56121/*'
|
|
94
94
|
curl -H "Authorization: Bearer $(oauth-token github)" https://api.github.com/user
|
|
95
|
-
`}async function d(n,r){let i=await import(`./account-store-
|
|
95
|
+
`}async function d(n,r){let i=await import(`./account-store-jjUZwcjI.js`).then(e=>e.t),a=await import(`./providers-CfE8Z8rn.js`).then(e=>e.r);if(t(n,{valueFlags:c}))return{stdout:u(),stderr:``,exitCode:0};let o=e(n,{value:c,bool:l});if(`error`in o)return H(`oauth-token: ${o.error}`);if(o.bools.has(`--list`))return U(i.getAccounts,a.getRegisteredProviderIds,a.getRegisteredProviderConfig,i.getOAuthAccountInfo);if(o.bools.has(`--check`))return T(o.positionals);if(o.bools.has(`--expire`))return O(o.positionals);if(o.bools.has(`--renew`))return k(o.positionals);if(o.values.has(`--from-file`)||o.bools.has(`--intercept`))return L(o,n,r);let s=f(o);if(!s.ok)return s.result;let d=o.bools.has(`--force-login`),m=p(o,i,a);if(!m.ok)return m.result;let _=h(m.value,a.getRegisteredProviderConfig);if(!_.ok)return _.result;if(!d){let e=await g(m.value,_.value,i.getOAuthAccountInfo,i.ensureOAuthMaskReplica,s.value);if(e?.ok)return e.value;if(e)return e.result}return b(m.value,_.value,s.value,i.getOAuthAccountInfo,i.ensureOAuthMaskReplica)}function f(e){if(!e.values.has(`--scope`))return{ok:!0,value:void 0};let t=e.values.get(`--scope`)?.trim();return!t||t.startsWith(`-`)?{ok:!1,result:H(`oauth-token: --scope requires a value`)}:{ok:!0,value:t}}function p(e,t,n){if(e.values.has(`--provider`)){let t=e.values.get(`--provider`);return t?{ok:!0,value:t}:{ok:!1,result:H(`oauth-token: --provider requires a value`)}}if(e.positionals.length>0)return{ok:!0,value:e.positionals[0]};let r=t.getSelectedProvider();if(m(n.getRegisteredProviderConfig(r)))return{ok:!0,value:r};let i=n.getRegisteredProviderIds().find(e=>m(n.getRegisteredProviderConfig(e)));return i?{ok:!0,value:i}:{ok:!1,result:H(`oauth-token: no OAuth providers configured`)}}function m(e){return!!(e?.isOAuth&&(e.onOAuthLogin||e.onOAuthLoginIntercepted))}function h(e,t){let n=t(e);return n?m(n)?{ok:!0,value:n}:{ok:!1,result:H(`oauth-token: provider "${e}" is not an OAuth provider`)}:{ok:!1,result:H(`oauth-token: unknown provider "${e}"`)}}async function g(e,t,n,r,i){let a=n(e);return a&&!a.expired?_(e,a,i,r):!a?.expired||!t.onSilentRenew||!await C(t.onSilentRenew)?null:_(e,n(e),i,r)}async function _(e,t,n,r){if(n&&!s(t?.scopes,n))return null;let i=v(t?.maskedValue,t?.token);if(i)return{ok:!0,value:i};if(!t?.token)return null;let a=await r(e)??{},o=v(a.maskedValue,t.token);return o?{ok:!0,value:o}:{ok:!1,result:y(e,a.error)}}function v(e,t){return!e||t&&e===t?null:{stdout:`${e}\n`,stderr:``,exitCode:0}}function y(e,t){return H(`oauth-token: token held for ${e} but no masked replica${t?` (${t})`:``}`)}async function b(e,t,n,r,i){try{let a=await x(e,t,n);return a.error?a.error:S(e,r,i,a.succeeded)}catch(t){let n=t instanceof Error?t.message:String(t);return t instanceof Error&&t.name===`OAuthLaunchError`?(console.error(`[oauth-token] Provider ${e}: login could not be shown:`,n),H(`oauth-token: ${n}`)):(console.error(`[oauth-token] Provider ${e}: login failed:`,n),H(`oauth-token: login failed: ${n}`))}}async function x(e,t,n){let r=n?{scopes:n}:void 0,i=!1,a=()=>{i=!0};if(t.onOAuthLoginIntercepted){let{createInterceptingOAuthLauncherForCurrentRuntime:n}=await import(`./oauth-service-CRmx6zI1.js`),o=await n();return o?(await t.onOAuthLoginIntercepted(o,a,r),{error:null,succeeded:i}):{error:H(`oauth-token: provider "${e}" needs the controlled-browser interceptor, but no CDP transport is available in this runtime.`),succeeded:!1}}if(t.onOAuthLogin){let{createOAuthLauncher:e}=await import(`./oauth-service-CRmx6zI1.js`);return await t.onOAuthLogin(e(),a,r),{error:null,succeeded:i}}return{error:H(`oauth-token: provider "${e}" has no OAuth login hook`),succeeded:!1}}async function S(e,t,n,r){if(!r)return console.error(`[oauth-token] Provider ${e}: interactive login was not completed`),H(`oauth-token: interactive login was not completed (cancelled, timed out, or no one could approve it)`);let i=t(e);if(i?.token&&!i.expired){let t=v(i.maskedValue,i.token);if(t)return t;let r=await n(e)??{};return v(r.maskedValue,i.token)||y(e,r.error)}return i?.token?H(`oauth-token: login completed but the saved token is already expired`):(console.error(`[oauth-token] Provider ${e}: login completed but no token was saved`),H(`oauth-token: login completed but no token was saved`))}async function C(e){try{return await e()!==null}catch{return!1}}function w(e,t,n,r,i){let a=e[0];if(a)return a;let o=n();return r(o)?.[t]?o:i().find(e=>r(e)?.[t])}async function T(e){let{getSelectedProvider:t,getOAuthAccountInfo:n}=await import(`./account-store-jjUZwcjI.js`).then(e=>e.t),{getRegisteredProviderConfig:r,getRegisteredProviderIds:i}=await import(`./providers-CfE8Z8rn.js`).then(e=>e.r),a=w(e,`onValidateToken`,t,r,i);if(!a)return H(`oauth-token --check: no provider supports an upstream token check`);let o=r(a);if(!o)return H(`oauth-token --check: unknown provider "${a}"`);if(!o.onValidateToken)return H(`oauth-token --check: provider "${a}" cannot be checked upstream (no onValidateToken hook); only locally stored state is known.`);let s=n(a),c=[`oauth-token --check ${a}`,` stored token: ${F(s)}`];if(!s)return c.push(` upstream check: skipped — nothing to check`,...M(a)),{stdout:c.join(`
|
|
96
96
|
`)+`
|
|
97
97
|
`,stderr:``,exitCode:3};let l=await j(o);if(l?.status===`accepted`){let e=l.userName?` (as ${l.userName})`:``;return c.push(` upstream check: ACCEPTED${e} — the provider honoured the token`),{stdout:c.join(`
|
|
98
98
|
`)+`
|
|
@@ -100,13 +100,13 @@ Examples:
|
|
|
100
100
|
`)+`
|
|
101
101
|
`,stderr:``,exitCode:e}}return c.push(` upstream check: UNKNOWN — the check itself could not run${D(l?.detail)}`,` This says nothing about the token. Retry when the provider is reachable.`),{stdout:c.join(`
|
|
102
102
|
`)+`
|
|
103
|
-
`,stderr:``,exitCode:1}}function E(e,t,n){let r=` upstream check: REJECTED — the provider refused the token${D(n)}`;return t?[r,` A stored refresh token may still be able to replace it — silent renewal`,` has not been tried yet.`,``,` → Next: oauth-token ${e} --renew`,` If that is declined too: oauth-token ${e} --force-login (needs a human).`]:[r,` This provider has no silent renewal, so nothing automated is left.`,...M(e)]}function D(e){return e?` (${e})`:``}async function O(e){let{getAccounts:t,getSelectedProvider:n,saveOAuthAccount:r}=await import(`./account-store-
|
|
103
|
+
`,stderr:``,exitCode:1}}function E(e,t,n){let r=` upstream check: REJECTED — the provider refused the token${D(n)}`;return t?[r,` A stored refresh token may still be able to replace it — silent renewal`,` has not been tried yet.`,``,` → Next: oauth-token ${e} --renew`,` If that is declined too: oauth-token ${e} --force-login (needs a human).`]:[r,` This provider has no silent renewal, so nothing automated is left.`,...M(e)]}function D(e){return e?` (${e})`:``}async function O(e){let{getAccounts:t,getSelectedProvider:n,saveOAuthAccount:r}=await import(`./account-store-jjUZwcjI.js`).then(e=>e.t),{getRegisteredProviderConfig:i,getRegisteredProviderIds:a}=await import(`./providers-CfE8Z8rn.js`).then(e=>e.r),o=w(e,`onSilentRenew`,n,i,a);if(!o)return H(`oauth-token --expire: no provider supports silent renewal`);let s=i(o);if(!s)return H(`oauth-token --expire: unknown provider "${o}"`);if(!s.onSilentRenew)return H(`oauth-token --expire: provider "${o}" has no onSilentRenew hook`);let c=t().find(e=>e.providerId===o);if(!c?.accessToken)return H(`oauth-token --expire: no stored OAuth account for "${o}"`);try{await r({...c,accessToken:c.accessToken,tokenExpiresAt:Date.now()-1e3})}catch(e){return H(`oauth-token --expire: failed to update "${o}": ${e instanceof Error?e.message:String(e)}`)}return{stdout:`oauth-token ${o}: stored token marked expired; next network op will trigger silent renewal.\n`,stderr:``,exitCode:0}}async function k(e){let{getSelectedProvider:t,getOAuthAccountInfo:n}=await import(`./account-store-jjUZwcjI.js`).then(e=>e.t),{getRegisteredProviderConfig:r,getRegisteredProviderIds:i}=await import(`./providers-CfE8Z8rn.js`).then(e=>e.r),a=w(e,`onSilentRenew`,t,r,i);if(!a)return H(`oauth-token --renew: no provider supports silent renewal`);let o=r(a);if(!o)return H(`oauth-token --renew: unknown provider "${a}"`);if(!o.onSilentRenew)return H(`oauth-token --renew: provider "${a}" has no onSilentRenew hook`);let s=n(a),c=s?.token,l=[`oauth-token --renew ${a}`];l.push(` stored token: ${F(s)}`);let u=null,d=null;try{u=await o.onSilentRenew()}catch(e){d=e instanceof Error?e.message:String(e)}if(u){let e=n(a),t=!!(c&&e?.token&&c!==e.token);return l.push(` silent renewal: SUCCESS${t?` — token refreshed`:` (token unchanged)`}`),l.push(` renewed token: ${F(e)}`),{stdout:l.join(`
|
|
104
104
|
`)+`
|
|
105
105
|
`,stderr:``,exitCode:0}}if(d)return l.push(` silent renewal: ERROR — ${d}`,...P(a)),{stdout:l.join(`
|
|
106
106
|
`)+`
|
|
107
107
|
`,stderr:``,exitCode:1};let f=A(a,await j(o));return l.push(...f.lines),{stdout:l.join(`
|
|
108
108
|
`)+`
|
|
109
|
-
`,stderr:``,exitCode:f.exitCode}}function A(e,t){let n=[` silent renewal: DECLINED — the provider returned no token without user`,` interaction (typically login_required: the upstream session has ended).`];if(t?.status===`rejected`)return{lines:[...n,` upstream check: REJECTED — the provider no longer accepts the stored`,` token${D(t.detail)}. Local expiry was never proof of validity.`,...M(e)],exitCode:3};if(t?.status===`accepted`){let e=t.userName?` (as ${t.userName})`:``;return{lines:[...n,` upstream check: ACCEPTED${e} — the stored token still works, so callers`,` are not blocked; only the renewal itself did not happen. No login needed.`],exitCode:1}}let r=[` Unconfirmed: provider renewal hooks also return no token when the renewal`,` call itself fails, so this alone does not prove the session ended.`];return t?.detail&&r.push(` (upstream check: ${t.detail})`),{lines:[...n,...r,...N(e)],exitCode:1}}async function j(e){return e.onValidateToken?e.onValidateToken().catch(e=>({status:`unknown`,detail:e instanceof Error?e.message:String(e)})):null}function M(e){return[``,` → Fix: oauth-token ${e} --force-login`,` Opens a consent window, so a human has to be at the keyboard: an`,` unattended agent should stop and ask the user to re-authorise rather`,` than retrying or probing further.`,` (Diagnostics, if a human is present: browser DevTools console,`,` "[oauth-service] Extension OAuth error".)`]}function N(e){return[``,` → Likely fix: oauth-token ${e} --force-login`,` Opens a consent window, so a human has to be at the keyboard. If the`,` failure was transient instead, a later retry succeeds on its own.`,` (Diagnostics: browser DevTools console, "[oauth-service] Extension`,` OAuth error".)`]}function P(e){return[``,` → The renewal call failed rather than being declined; this is often`,` transient (offline, 5xx, bridge not up). Retry it.`,` If it keeps failing: oauth-token ${e} --force-login (needs a human).`]}function F(e){return e?e.expired?`present, ${I(e.expiresAt)} — renewal needed`:`present, ${I(e.expiresAt)}, not validated upstream`:`none stored`}function I(e){if(!e)return`no local expiry recorded`;let t=e-Date.now();if(t<=0)return`past its local expiry`;if(t<6e4)return`local expiry in under a minute`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return`local expiry in ${n>0?`${n}h ${r}m`:`${r}m`}`}async function L(e,t,n){let{parseInterceptOAuthConfig:r}=await import(`./intercepted-oauth-B0tP4D7f.js`).then(e=>e.n),{createInterceptingOAuthLauncherForCurrentRuntime:i}=await import(`./oauth-service-
|
|
109
|
+
`,stderr:``,exitCode:f.exitCode}}function A(e,t){let n=[` silent renewal: DECLINED — the provider returned no token without user`,` interaction (typically login_required: the upstream session has ended).`];if(t?.status===`rejected`)return{lines:[...n,` upstream check: REJECTED — the provider no longer accepts the stored`,` token${D(t.detail)}. Local expiry was never proof of validity.`,...M(e)],exitCode:3};if(t?.status===`accepted`){let e=t.userName?` (as ${t.userName})`:``;return{lines:[...n,` upstream check: ACCEPTED${e} — the stored token still works, so callers`,` are not blocked; only the renewal itself did not happen. No login needed.`],exitCode:1}}let r=[` Unconfirmed: provider renewal hooks also return no token when the renewal`,` call itself fails, so this alone does not prove the session ended.`];return t?.detail&&r.push(` (upstream check: ${t.detail})`),{lines:[...n,...r,...N(e)],exitCode:1}}async function j(e){return e.onValidateToken?e.onValidateToken().catch(e=>({status:`unknown`,detail:e instanceof Error?e.message:String(e)})):null}function M(e){return[``,` → Fix: oauth-token ${e} --force-login`,` Opens a consent window, so a human has to be at the keyboard: an`,` unattended agent should stop and ask the user to re-authorise rather`,` than retrying or probing further.`,` (Diagnostics, if a human is present: browser DevTools console,`,` "[oauth-service] Extension OAuth error".)`]}function N(e){return[``,` → Likely fix: oauth-token ${e} --force-login`,` Opens a consent window, so a human has to be at the keyboard. If the`,` failure was transient instead, a later retry succeeds on its own.`,` (Diagnostics: browser DevTools console, "[oauth-service] Extension`,` OAuth error".)`]}function P(e){return[``,` → The renewal call failed rather than being declined; this is often`,` transient (offline, 5xx, bridge not up). Retry it.`,` If it keeps failing: oauth-token ${e} --force-login (needs a human).`]}function F(e){return e?e.expired?`present, ${I(e.expiresAt)} — renewal needed`:`present, ${I(e.expiresAt)}, not validated upstream`:`none stored`}function I(e){if(!e)return`no local expiry recorded`;let t=e-Date.now();if(t<=0)return`past its local expiry`;if(t<6e4)return`local expiry in under a minute`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return`local expiry in ${n>0?`${n}h ${r}m`:`${r}m`}`}async function L(e,t,n){let{parseInterceptOAuthConfig:r}=await import(`./intercepted-oauth-B0tP4D7f.js`).then(e=>e.n),{createInterceptingOAuthLauncherForCurrentRuntime:i}=await import(`./oauth-service-CRmx6zI1.js`),a=await R(e,t,n);if(!a.ok)return a.result;let o=r(a.value);if(!o.ok)return H(`oauth-token: invalid intercept config: ${o.error}`);let s=await i();if(!s)return H(`oauth-token: no CDP transport available in this runtime; --intercept needs the controlled browser.`);let c=await s(o.config);return c?{stdout:`${c}\n`,stderr:``,exitCode:0}:H(`oauth-token: intercept timed out or was cancelled`)}function R(e,t,n){return e.values.has(`--from-file`)?z(e.values.get(`--from-file`),n):B(e,t)}async function z(e,t){if(!e)return{ok:!1,result:H(`oauth-token: --from-file requires a path`)};try{let n=t.fs.resolvePath(t.cwd,e),r=await t.fs.readFile(n),i=typeof r==`string`?r:new TextDecoder().decode(r);return{ok:!0,value:JSON.parse(i)}}catch(t){return{ok:!1,result:H(`oauth-token: failed to read ${e}: ${t instanceof Error?t.message:String(t)}`)}}}function B(e,t){let n=e.values.get(`--authorize-url`),r=e.values.get(`--redirect-pattern`);if(!n)return{ok:!1,result:H(`oauth-token: --authorize-url is required`)};if(!r)return{ok:!1,result:H(`oauth-token: --redirect-pattern is required`)};let i=V(t);return i.ok?{ok:!0,value:{authorizeUrl:n,redirectUriPattern:r,onCapture:e.bools.has(`--leave-tab`)?`leave`:`close`,...i.value.length>0?{rewrite:i.value}:{}}}:i}function V(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r===`--`)break;if(r!==`--rewrite`&&!r.startsWith(`--rewrite=`))continue;let i=r===`--rewrite`?e[++n]:r.slice(10);if(!i)return{ok:!1,result:H(`oauth-token: --rewrite requires a value`)};let a=i.split(`=`);if(a.length<3)return{ok:!1,result:H(`oauth-token: --rewrite "${i}" must be "<match>=<key>=<value>"`)};let[o,s,...c]=a;t.push({match:o,appendParams:{[s]:c.join(`=`)}})}return{ok:!0,value:t}}function H(e){return{stdout:``,stderr:`${e}\n`,exitCode:1}}function U(e,t,n,r){let i=t().filter(e=>n(e)?.isOAuth);if(i.length===0)return{stdout:`No OAuth providers configured.
|
|
110
110
|
`,stderr:``,exitCode:0};let a=[],o=!1;for(let e of i){let t=r(e);if(!t){a.push(`${e} (no token)`);continue}o=!0,a.push(`${e} (${W(t).join(`, `)})`)}return o&&a.push(``,`Local state only — a held token can already be rejected upstream.`,`Verify with "oauth-token --check <id>"; re-consent with "oauth-token <id> --force-login".`),{stdout:a.join(`
|
|
111
111
|
`)+`
|
|
112
112
|
`,stderr:``,exitCode:0}}function W(e){let t=[e.userName?`token held for ${e.userName}`:`token held`];return t.push(I(e.expiresAt)),e.expired&&t.push(`renewal needed`),e.scopes&&t.push(`scopes: ${e.scopes}`),t}export{d as runOAuthToken};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./subcommand-flags-BZi7j78Q.js";import{r as t,t as n}from"./subcommand-help-CgO7wRS5.js";import{i as r,r as i}from"./jsh-discovery-D3Gk1cKA.js";import{a,i as o,r as s,s as c,t as l}from"./supervisor-
|
|
1
|
+
import{t as e}from"./subcommand-flags-BZi7j78Q.js";import{r as t,t as n}from"./subcommand-help-CgO7wRS5.js";import{i as r,r as i}from"./jsh-discovery-D3Gk1cKA.js";import{a,i as o,r as s,s as c,t as l}from"./supervisor-C1sPrIbH.js";const u=`usage: jshd <command> [options]
|
|
2
2
|
|
|
3
3
|
Durable background jsh units: one realm worker each, restored on reload
|
|
4
4
|
when --enable is set. Keep-alive follows the realm (pending timers and
|
|
@@ -34,7 +34,7 @@ Notes:
|
|
|
34
34
|
`)+`
|
|
35
35
|
`)}async function A(e,t,n,r){let i=t[0];if(!i)return Y(`missing unit name`);let o=L(n);if(o)return o;let s=P(n,r);if(!s)return Y(`kernel host has not booted yet — try again in a moment`);if(e===`stop`)return await s.stop(i)?J(`jshd: stopped '${i}'\n`):await a(n.fs,i)?J(`jshd: unit '${i}' is not running\n`):Y(`unknown unit '${i}'`);if(e===`restart`){let e=await s.restart(i);return e?J(`jshd: restarted '${i}' (pid ${e.pid})\n`):Y(`unknown unit '${i}'`)}return!await a(n.fs,i)&&!s.status(i)?Y(`unknown unit '${i}'`):(await s.rm(i),J(`jshd: removed '${i}'\n`))}async function j(t,n,r){let i=e(t,{value:T,bool:[`-f`,`--follow`]});if(`error`in i)return Y(i.error);let a=i.positionals[0];if(!a)return Y(`missing unit name`);let s=i.bools.has(`-f`)||i.bools.has(`--follow`),c=i.values.get(`-n`)??i.values.get(`--lines`),l=c===void 0?void 0:Number.parseInt(c,10);if(c!==void 0&&(!Number.isFinite(l)||l<0))return Y(`-n must be a non-negative integer`);let u=await o(n.fs,a),d=l===void 0?u:H(u,l);if(!s)return J(d.endsWith(`
|
|
36
36
|
`)||d.length===0?d:`${d}\n`);let f=W(n),p=G(n);return f?U({ctx:n,name:a,displayed:d,seen:u.length,signal:f,sink:p}):(p?.(d),J(p?``:d.endsWith(`
|
|
37
|
-
`)||d.length===0?d:`${d}\n`))}async function M(e,t,n,r){let i=e[0];if(!i)return Y(`missing unit name`);let a=L(t);if(a)return a;let o=P(t,n);return(o?await o.setEnabled(i,r):await N(t,i,r))?J(`jshd: ${r?`enabled`:`disabled`} '${i}'\n`):Y(`unknown unit '${i}'`)}async function N(e,t,n){let r=await a(e.fs,t);if(!r)return null;let i={...r,enabled:n},{writeUnitRecord:o}=await import(`./supervisor-
|
|
37
|
+
`)||d.length===0?d:`${d}\n`))}async function M(e,t,n,r){let i=e[0];if(!i)return Y(`missing unit name`);let a=L(t);if(a)return a;let o=P(t,n);return(o?await o.setEnabled(i,r):await N(t,i,r))?J(`jshd: ${r?`enabled`:`disabled`} '${i}'\n`):Y(`unknown unit '${i}'`)}async function N(e,t,n){let r=await a(e.fs,t);if(!r)return null;let i={...r,enabled:n},{writeUnitRecord:o}=await import(`./supervisor-C1sPrIbH.js`).then(e=>e.o);return await o(e.fs,i),i}function P(e,t){let n=l();if(n)return n;let r=t.processManager??K();if(!r)return null;let i=q();return l({fs:e.fs,processManager:r,...i?{lickManager:i}:{},...t.realmFactory?{realmFactory:t.realmFactory}:{},buildContext:t=>F(e,t)})}function F(e,t){let n=new Map(e.env);for(let[e,r]of Object.entries(t.env))n.set(e,r);return{...e,cwd:t.cwd,env:n}}function I(e){if(typeof e!=`object`||!e)return!1;let t=e.canWrite;return typeof t==`function`&&!t.call(e,`/workspace/.jshd`)}function L(e){return I(e.fs)?Y(`not available inside a restricted scoop`):null}function R(e,t,n){let r=new Map(t.map(e=>[e.name,e]));return[...new Set([...e.map(e=>e.name),...r.keys()])].sort().map(t=>r.get(t)||z(e.find(e=>e.name===t),n))}function z(e,t){return{name:e.name,pid:null,state:`stopped`,restarts:0,uptimeMs:null,enabled:e.enabled,restart:e.restart,argv:e.argv,cwd:e.cwd,durable:t,lastExitCode:null}}function B(e){let t=e.pid===null?`-`:String(e.pid),n=V(e.uptimeMs);return[e.name.padEnd(15),t.padEnd(7),e.state.padEnd(9),String(e.restarts).padEnd(9),n.padEnd(6),String(e.enabled).padEnd(8),String(e.durable)].join(` `)}function V(e){if(e===null)return`-`;let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m${t%60}s`}function H(e,t){if(t===0)return``;let n=e.split(`
|
|
38
38
|
`);return n[n.length-1]===``&&n.pop(),`${n.slice(-t).join(`
|
|
39
39
|
`)}${e.endsWith(`
|
|
40
40
|
`)?`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./base64-BPBW1Gzr.js";import{m as t}from"./state-BCTAzK_L.js";import{t as n}from"./realm-browser-fetch-V3uggGbM.js";const r=new TextEncoder;function i(e){return typeof e==`object`&&!!e&&`exitCode`in e}async function a(e,t){try{return await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,t))}catch{return{message:`curlwright: cannot read ${t}`,exitCode:26}}}function o(e){let t=new Uint8Array(e.length),n=0;for(let r of e)r!==10&&r!==13&&(t[n++]=r);return t.subarray(0,n)}async function s(e,t){let n=t.indexOf(`=`),o=t.indexOf(`@`),s=o!==-1&&(n===-1||o<n),c=s?o:n,l=c===-1?``:t.slice(0,c),u=c===-1?t:t.slice(c+1),d=u;if(s){let t=await a(e,u);if(i(t))return t;d=new TextDecoder().decode(t)}let f=encodeURIComponent(d);return r.encode(l===``?f:`${l}=${f}`)}async function c(e,t){if(t.kind===`urlencode`)return s(e,t.value);if(t.kind===`raw`||!t.value.startsWith(`@`))return r.encode(t.value);let n=await a(e,t.value.slice(1));return i(n)||t.kind===`binary`?n:o(n)}function l(e){let t=Math.max(0,e.length-1),n=e.reduce((e,t)=>e+t.length,0)+t,r=new Uint8Array(n),i=0;return e.forEach((e,t)=>{t>0&&(r[i++]=38),r.set(e,i),i+=e.length}),r}function u(e){let t=e.split(`;`);return{value:t[0],options:t.slice(1)}}function d(e,t){for(let n of e){let e=n.trim();if(e.startsWith(`${t}=`))return e.slice(t.length+1)}return null}function f(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}async function p(e,t,n){let r=n.value.indexOf(`=`);if(r===-1)return{message:`curlwright: -F requires name=content (got "${n.value}")`,exitCode:2};let o=n.value.slice(0,r),s=n.value.slice(r+1);if(n.literal||s[0]!==`@`&&s[0]!==`<`)return t.append(o,s),null;let{value:c,options:l}=u(s.slice(1)),p=await a(e,c);if(i(p))return p;if(s[0]===`<`)return t.append(o,new TextDecoder().decode(p)),null;let m=d(l,`type`)??`application/octet-stream`,h=d(l,`filename`)??f(c);return t.append(o,new Blob([p],{type:m}),h),null}async function m(e,t,n){if(t.length>0&&n.length>0)return{message:`curlwright: -F cannot be combined with -d`,exitCode:2};if(n.length>0){let t=new FormData;for(let r of n){let n=await p(e,t,r);if(n)return n}return{bytes:null,form:t,contentType:null,accept:null}}if(t.length===0)return{bytes:null,form:null,contentType:null,accept:null};let r=[];for(let n of t){let t=await c(e,n);if(i(t))return t;r.push(t)}let a=t.some(e=>e.kind===`json`);return{bytes:l(r),form:null,contentType:a?`application/json`:`application/x-www-form-urlencoded`,accept:a?`application/json`:null}}const h=new Set([`request`,`header`,`data`,`data-raw`,`data-binary`,`data-ascii`,`data-urlencode`,`json`,`form`,`form-string`,`output`,`dump-header`,`write-out`,`max-time`,`user`,`referer`,`range`,`url`,`tab`,`frame`]),g=new Set([`silent`,`show-error`,`include`,`head`,`verbose`,`fail`,`location`,`remote-name`,`get`,`no-credentials`,`help`]),_={X:`request`,H:`header`,d:`data`,F:`form`,o:`output`,D:`dump-header`,w:`write-out`,m:`max-time`,u:`user`,e:`referer`,r:`range`},v={s:`silent`,S:`show-error`,i:`include`,I:`head`,v:`verbose`,f:`fail`,L:`location`,O:`remote-name`,G:`get`,h:`help`},y={cert:`client certificates are the browser profile's to present, not the shell's`,"cert-type":`client certificates are the browser profile's to present, not the shell's`,key:`client certificates are the browser profile's to present, not the shell's`,cacert:`the browser decides which roots to trust`,capath:`the browser decides which roots to trust`,insecure:`the browser enforces TLS verification; a page cannot opt out`,proxy:`proxying is configured on the browser, not per request`,"proxy-user":`proxying is configured on the browser, not per request`,interface:`a page cannot choose an outgoing interface`,"unix-socket":`a page cannot dial a unix socket`,resolve:`a page cannot override DNS resolution`,compressed:`always on — the browser negotiates encoding itself`,cookie:"the tab's own cookies are already sent; set one with `playwright-cli cookie-set`","cookie-jar":"cookies live in the browser profile; read them with `playwright-cli cookies`","limit-rate":`a page cannot throttle a fetch`,"continue-at":"a page fetch cannot resume; use `-H 'Range: bytes=N-'`","connect-timeout":"a page fetch cannot time the connect phase alone; use `--max-time`","http1.1":`the browser negotiates the HTTP version`,http2:`the browser negotiates the HTTP version`,http3:`the browser negotiates the HTTP version`,"no-buffer":`responses are read whole, never streamed to stdout`,"trace-ascii":"no wire trace exists; use `playwright-cli network-requests`",trace:"no wire trace exists; use `playwright-cli network-requests`","user-agent":`User-Agent is a forbidden header name for fetch(); the tab sets it`},b={k:`insecure`,x:`proxy`,b:`cookie`,c:`cookie-jar`,E:`cert`,C:`continue-at`,N:`no-buffer`,A:`user-agent`};function ee(){return{url:null,requestMethod:null,headers:[],data:[],form:[],get:!1,output:null,remoteName:!1,include:!1,head:!1,dumpHeader:null,writeOut:null,silent:!1,showError:!1,verbose:!1,failOnError:!1,maxTimeSeconds:null,credentials:`include`,tab:null,frame:null,user:null,referer:null,range:null,help:!1}}function x(e,t){return{message:`curlwright: option ${e} is not supported in a page context — ${y[t]}`,exitCode:2}}function S(e){return{message:`curlwright: unknown option ${e}\nRun 'curlwright --help' for the supported flags.`,exitCode:2}}function C(e){let t=e.indexOf(`:`);if(t===-1)return e.endsWith(`;`)?{name:e.slice(0,-1).trim(),value:``,unset:!1}:{name:e.trim(),value:``,unset:!1};let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();return{name:n,value:r,unset:r===``}}function w(e,t,n,r){switch(t){case`request`:return e.requestMethod=n,null;case`header`:return e.headers.push(C(n??``)),null;case`data`:case`data-ascii`:return e.data.push({kind:`ascii`,value:n??``}),null;case`data-raw`:return e.data.push({kind:`raw`,value:n??``}),null;case`data-binary`:return e.data.push({kind:`binary`,value:n??``}),null;case`data-urlencode`:return e.data.push({kind:`urlencode`,value:n??``}),null;case`json`:return e.data.push({kind:`json`,value:n??``}),null;case`form`:return e.form.push({value:n??``,literal:!1}),null;case`form-string`:return e.form.push({value:n??``,literal:!0}),null;case`output`:return e.output=n,null;case`dump-header`:return e.dumpHeader=n,null;case`write-out`:return e.writeOut=n,null;case`max-time`:return T(e,n,r);case`user`:return e.user=n,null;case`referer`:return e.referer=n,null;case`range`:return e.range=n,null;case`url`:return e.url=n,null;case`tab`:return e.tab=n,null;case`frame`:return e.frame=n,null;default:return E(e,t,r)}}function T(e,t,n){let r=Number(t);return!Number.isFinite(r)||r<=0?{message:`curlwright: ${n} expects a positive number of seconds`,exitCode:2}:(e.maxTimeSeconds=r,null)}function E(e,t,n){switch(t){case`silent`:return e.silent=!0,null;case`show-error`:return e.showError=!0,null;case`include`:return e.include=!0,null;case`head`:return e.head=!0,null;case`verbose`:return e.verbose=!0,null;case`fail`:return e.failOnError=!0,null;case`location`:return null;case`remote-name`:return e.remoteName=!0,null;case`get`:return e.get=!0,null;case`no-credentials`:return e.credentials=`omit`,null;case`help`:return e.help=!0,null;default:return S(n)}}function te(e,t,n){let r=t[n],i=r.indexOf(`=`),a=(i===-1?r.slice(2):r.slice(2,i)).trim(),o=i===-1?null:r.slice(i+1);if(a in y)return x(`--${a}`,a);if(h.has(a)){let r=o??t[n+1];return r===void 0?{message:`curlwright: option --${a} requires a value`,exitCode:2}:w(e,a,r,`--${a}`)??{next:o===null?n+2:n+1}}return g.has(a)?w(e,a,null,`--${a}`)??{next:n+1}:S(`--${a}`)}function ne(e,t,n){let r=t[n];for(let i=1;i<r.length;i++){let a=r[i];if(a in b)return x(`-${a}`,b[a]);if(a in _){let o=r.slice(i+1),s=o===``?t[n+1]:o;return s===void 0?{message:`curlwright: option -${a} requires a value`,exitCode:2}:w(e,_[a],s,`-${a}`)??{next:o===``?n+2:n+1}}if(!(a in v))return S(`-${a}`);let o=w(e,v[a],null,`-${a}`);if(o)return o}return{next:n+1}}function re(e,t){return e.url!==null&&e.url!==t?{message:`curlwright: only one URL is supported (got "${e.url}" and "${t}")`,exitCode:2}:(e.url=t,null)}function ie(e){let t=ee(),n=0,r=!1;for(;n<e.length;){let i=e[n];if(!r&&i===`--`){r=!0,n++;continue}if(!r&&i.startsWith(`--`)){let r=te(t,e,n);if(`message`in r)return r;n=r.next;continue}if(!r&&i.startsWith(`-`)&&i.length>1){let r=ne(t,e,n);if(`message`in r)return r;n=r.next;continue}let a=re(t,i);if(a)return a;n++}return t}function ae(e){return`message`in e}const D={"accept-charset":`the browser sets it`,"accept-encoding":`the browser negotiates encoding`,connection:`the browser owns the connection`,"content-length":`derived from the body`,cookie:"the tab's cookies are sent already; set one with `playwright-cli cookie-set`",cookie2:`the tab's cookies are sent already`,date:`the browser sets it`,dnt:`the browser sets it`,expect:`a page fetch cannot send it`,host:`derived from the URL`,"keep-alive":`the browser owns the connection`,origin:`the tab's own origin is sent automatically`,referer:`use -e/--referer, which sets the fetch referrer`,te:`the browser owns transfer encoding`,trailer:`the browser owns transfer encoding`,"transfer-encoding":`the browser owns transfer encoding`,upgrade:`the browser owns the connection`,via:`the browser sets it`};function oe(e){let t=e.toLowerCase();return t in D?D[t]:t.startsWith(`proxy-`)?`proxying is configured on the browser`:t.startsWith(`sec-`)?`Sec- headers are reserved for the browser`:null}function se(e){for(let t of e){let e=oe(t.name);if(e)return{message:`curlwright: header "${t.name}" cannot be set from a page — ${e}`,exitCode:2}}return null}function O(e,t){let n=t.toLowerCase();return Object.keys(e).some(e=>e.toLowerCase()===n)}function k(e){let t={},n=new Set;for(let r of e.headers)if(r.name!==``){if(r.unset){n.add(r.name.toLowerCase());continue}t[r.name]=r.value}return{headers:t,suppressed:n}}function A(e,t,n){return!O(e,n)&&!t.has(n)}function j(e){return/^[a-zA-Z]+=/.test(e)?e:`bytes=${e}`}function M(e,t,n,r){n.user!==null&&A(e,t,`authorization`)&&(e.Authorization=`Basic ${btoa(n.user)}`),n.range!==null&&A(e,t,`range`)&&(e.Range=j(n.range)),r.contentType&&A(e,t,`content-type`)&&(e[`Content-Type`]=r.contentType),r.accept&&A(e,t,`accept`)&&(e.Accept=r.accept)}function N(e,t){if(t===``)return e;let[n,r]=P(e);return`${n}${n.includes(`?`)?`&`:`?`}${t}${r}`}function P(e){let t=e.indexOf(`#`);return t===-1?[e,``]:[e.slice(0,t),e.slice(t)]}function F(e,t){return e.requestMethod?e.requestMethod:e.head?`HEAD`:t?`POST`:`GET`}function I(e,t,n){let r=e.toUpperCase();return!t||r!==`GET`&&r!==`HEAD`?null:{message:`curlwright: ${n.requestMethod?`-X ${n.requestMethod}`:`-I`} cannot carry a request body — a page fetch rejects a ${r} with one. Drop the data, or use -G to send it as a query string.`,exitCode:2}}function L(e,t){if(e.url===null)return{message:`curlwright: no URL specified`,exitCode:2};let{headers:n,suppressed:r}=k(e),i=e.get&&t.bytes!==null,a=i?{...t,bytes:null,contentType:null}:t;M(n,r,e,a);let o=i?N(e.url,new TextDecoder().decode(t.bytes??new Uint8Array)):e.url,s=a.bytes!==null||a.form!==null,c=F(e,s),l=I(c,s,e);if(l)return l;let u={method:c,headers:n,credentials:e.credentials,responseType:`binary`};return a.form?u.body=a.form:a.bytes&&(u.body=a.bytes),e.referer!==null&&(u.referrer=e.referer),e.maxTimeSeconds!==null&&(u.timeoutMs=e.maxTimeSeconds*1e3),{url:o,method:c,fetchOptions:u,uploadSize:a.bytes?.length??0}}function R(e){let t=e.fetchOptions.headers??{},n=[`> ${e.method} ${e.url}`];for(let[e,r]of Object.entries(t))n.push(`> ${e}: ${r}`);return n.push(`> `),`${n.join(`
|
|
1
|
+
import{t as e}from"./base64-BPBW1Gzr.js";import{m as t}from"./state-RVr0GidF.js";import{t as n}from"./realm-browser-fetch-V3uggGbM.js";const r=new TextEncoder;function i(e){return typeof e==`object`&&!!e&&`exitCode`in e}async function a(e,t){try{return await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,t))}catch{return{message:`curlwright: cannot read ${t}`,exitCode:26}}}function o(e){let t=new Uint8Array(e.length),n=0;for(let r of e)r!==10&&r!==13&&(t[n++]=r);return t.subarray(0,n)}async function s(e,t){let n=t.indexOf(`=`),o=t.indexOf(`@`),s=o!==-1&&(n===-1||o<n),c=s?o:n,l=c===-1?``:t.slice(0,c),u=c===-1?t:t.slice(c+1),d=u;if(s){let t=await a(e,u);if(i(t))return t;d=new TextDecoder().decode(t)}let f=encodeURIComponent(d);return r.encode(l===``?f:`${l}=${f}`)}async function c(e,t){if(t.kind===`urlencode`)return s(e,t.value);if(t.kind===`raw`||!t.value.startsWith(`@`))return r.encode(t.value);let n=await a(e,t.value.slice(1));return i(n)||t.kind===`binary`?n:o(n)}function l(e){let t=Math.max(0,e.length-1),n=e.reduce((e,t)=>e+t.length,0)+t,r=new Uint8Array(n),i=0;return e.forEach((e,t)=>{t>0&&(r[i++]=38),r.set(e,i),i+=e.length}),r}function u(e){let t=e.split(`;`);return{value:t[0],options:t.slice(1)}}function d(e,t){for(let n of e){let e=n.trim();if(e.startsWith(`${t}=`))return e.slice(t.length+1)}return null}function f(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?t:t.slice(n+1)}async function p(e,t,n){let r=n.value.indexOf(`=`);if(r===-1)return{message:`curlwright: -F requires name=content (got "${n.value}")`,exitCode:2};let o=n.value.slice(0,r),s=n.value.slice(r+1);if(n.literal||s[0]!==`@`&&s[0]!==`<`)return t.append(o,s),null;let{value:c,options:l}=u(s.slice(1)),p=await a(e,c);if(i(p))return p;if(s[0]===`<`)return t.append(o,new TextDecoder().decode(p)),null;let m=d(l,`type`)??`application/octet-stream`,h=d(l,`filename`)??f(c);return t.append(o,new Blob([p],{type:m}),h),null}async function m(e,t,n){if(t.length>0&&n.length>0)return{message:`curlwright: -F cannot be combined with -d`,exitCode:2};if(n.length>0){let t=new FormData;for(let r of n){let n=await p(e,t,r);if(n)return n}return{bytes:null,form:t,contentType:null,accept:null}}if(t.length===0)return{bytes:null,form:null,contentType:null,accept:null};let r=[];for(let n of t){let t=await c(e,n);if(i(t))return t;r.push(t)}let a=t.some(e=>e.kind===`json`);return{bytes:l(r),form:null,contentType:a?`application/json`:`application/x-www-form-urlencoded`,accept:a?`application/json`:null}}const h=new Set([`request`,`header`,`data`,`data-raw`,`data-binary`,`data-ascii`,`data-urlencode`,`json`,`form`,`form-string`,`output`,`dump-header`,`write-out`,`max-time`,`user`,`referer`,`range`,`url`,`tab`,`frame`]),g=new Set([`silent`,`show-error`,`include`,`head`,`verbose`,`fail`,`location`,`remote-name`,`get`,`no-credentials`,`help`]),_={X:`request`,H:`header`,d:`data`,F:`form`,o:`output`,D:`dump-header`,w:`write-out`,m:`max-time`,u:`user`,e:`referer`,r:`range`},v={s:`silent`,S:`show-error`,i:`include`,I:`head`,v:`verbose`,f:`fail`,L:`location`,O:`remote-name`,G:`get`,h:`help`},y={cert:`client certificates are the browser profile's to present, not the shell's`,"cert-type":`client certificates are the browser profile's to present, not the shell's`,key:`client certificates are the browser profile's to present, not the shell's`,cacert:`the browser decides which roots to trust`,capath:`the browser decides which roots to trust`,insecure:`the browser enforces TLS verification; a page cannot opt out`,proxy:`proxying is configured on the browser, not per request`,"proxy-user":`proxying is configured on the browser, not per request`,interface:`a page cannot choose an outgoing interface`,"unix-socket":`a page cannot dial a unix socket`,resolve:`a page cannot override DNS resolution`,compressed:`always on — the browser negotiates encoding itself`,cookie:"the tab's own cookies are already sent; set one with `playwright-cli cookie-set`","cookie-jar":"cookies live in the browser profile; read them with `playwright-cli cookies`","limit-rate":`a page cannot throttle a fetch`,"continue-at":"a page fetch cannot resume; use `-H 'Range: bytes=N-'`","connect-timeout":"a page fetch cannot time the connect phase alone; use `--max-time`","http1.1":`the browser negotiates the HTTP version`,http2:`the browser negotiates the HTTP version`,http3:`the browser negotiates the HTTP version`,"no-buffer":`responses are read whole, never streamed to stdout`,"trace-ascii":"no wire trace exists; use `playwright-cli network-requests`",trace:"no wire trace exists; use `playwright-cli network-requests`","user-agent":`User-Agent is a forbidden header name for fetch(); the tab sets it`},b={k:`insecure`,x:`proxy`,b:`cookie`,c:`cookie-jar`,E:`cert`,C:`continue-at`,N:`no-buffer`,A:`user-agent`};function ee(){return{url:null,requestMethod:null,headers:[],data:[],form:[],get:!1,output:null,remoteName:!1,include:!1,head:!1,dumpHeader:null,writeOut:null,silent:!1,showError:!1,verbose:!1,failOnError:!1,maxTimeSeconds:null,credentials:`include`,tab:null,frame:null,user:null,referer:null,range:null,help:!1}}function x(e,t){return{message:`curlwright: option ${e} is not supported in a page context — ${y[t]}`,exitCode:2}}function S(e){return{message:`curlwright: unknown option ${e}\nRun 'curlwright --help' for the supported flags.`,exitCode:2}}function C(e){let t=e.indexOf(`:`);if(t===-1)return e.endsWith(`;`)?{name:e.slice(0,-1).trim(),value:``,unset:!1}:{name:e.trim(),value:``,unset:!1};let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();return{name:n,value:r,unset:r===``}}function w(e,t,n,r){switch(t){case`request`:return e.requestMethod=n,null;case`header`:return e.headers.push(C(n??``)),null;case`data`:case`data-ascii`:return e.data.push({kind:`ascii`,value:n??``}),null;case`data-raw`:return e.data.push({kind:`raw`,value:n??``}),null;case`data-binary`:return e.data.push({kind:`binary`,value:n??``}),null;case`data-urlencode`:return e.data.push({kind:`urlencode`,value:n??``}),null;case`json`:return e.data.push({kind:`json`,value:n??``}),null;case`form`:return e.form.push({value:n??``,literal:!1}),null;case`form-string`:return e.form.push({value:n??``,literal:!0}),null;case`output`:return e.output=n,null;case`dump-header`:return e.dumpHeader=n,null;case`write-out`:return e.writeOut=n,null;case`max-time`:return T(e,n,r);case`user`:return e.user=n,null;case`referer`:return e.referer=n,null;case`range`:return e.range=n,null;case`url`:return e.url=n,null;case`tab`:return e.tab=n,null;case`frame`:return e.frame=n,null;default:return E(e,t,r)}}function T(e,t,n){let r=Number(t);return!Number.isFinite(r)||r<=0?{message:`curlwright: ${n} expects a positive number of seconds`,exitCode:2}:(e.maxTimeSeconds=r,null)}function E(e,t,n){switch(t){case`silent`:return e.silent=!0,null;case`show-error`:return e.showError=!0,null;case`include`:return e.include=!0,null;case`head`:return e.head=!0,null;case`verbose`:return e.verbose=!0,null;case`fail`:return e.failOnError=!0,null;case`location`:return null;case`remote-name`:return e.remoteName=!0,null;case`get`:return e.get=!0,null;case`no-credentials`:return e.credentials=`omit`,null;case`help`:return e.help=!0,null;default:return S(n)}}function te(e,t,n){let r=t[n],i=r.indexOf(`=`),a=(i===-1?r.slice(2):r.slice(2,i)).trim(),o=i===-1?null:r.slice(i+1);if(a in y)return x(`--${a}`,a);if(h.has(a)){let r=o??t[n+1];return r===void 0?{message:`curlwright: option --${a} requires a value`,exitCode:2}:w(e,a,r,`--${a}`)??{next:o===null?n+2:n+1}}return g.has(a)?w(e,a,null,`--${a}`)??{next:n+1}:S(`--${a}`)}function ne(e,t,n){let r=t[n];for(let i=1;i<r.length;i++){let a=r[i];if(a in b)return x(`-${a}`,b[a]);if(a in _){let o=r.slice(i+1),s=o===``?t[n+1]:o;return s===void 0?{message:`curlwright: option -${a} requires a value`,exitCode:2}:w(e,_[a],s,`-${a}`)??{next:o===``?n+2:n+1}}if(!(a in v))return S(`-${a}`);let o=w(e,v[a],null,`-${a}`);if(o)return o}return{next:n+1}}function re(e,t){return e.url!==null&&e.url!==t?{message:`curlwright: only one URL is supported (got "${e.url}" and "${t}")`,exitCode:2}:(e.url=t,null)}function ie(e){let t=ee(),n=0,r=!1;for(;n<e.length;){let i=e[n];if(!r&&i===`--`){r=!0,n++;continue}if(!r&&i.startsWith(`--`)){let r=te(t,e,n);if(`message`in r)return r;n=r.next;continue}if(!r&&i.startsWith(`-`)&&i.length>1){let r=ne(t,e,n);if(`message`in r)return r;n=r.next;continue}let a=re(t,i);if(a)return a;n++}return t}function ae(e){return`message`in e}const D={"accept-charset":`the browser sets it`,"accept-encoding":`the browser negotiates encoding`,connection:`the browser owns the connection`,"content-length":`derived from the body`,cookie:"the tab's cookies are sent already; set one with `playwright-cli cookie-set`",cookie2:`the tab's cookies are sent already`,date:`the browser sets it`,dnt:`the browser sets it`,expect:`a page fetch cannot send it`,host:`derived from the URL`,"keep-alive":`the browser owns the connection`,origin:`the tab's own origin is sent automatically`,referer:`use -e/--referer, which sets the fetch referrer`,te:`the browser owns transfer encoding`,trailer:`the browser owns transfer encoding`,"transfer-encoding":`the browser owns transfer encoding`,upgrade:`the browser owns the connection`,via:`the browser sets it`};function oe(e){let t=e.toLowerCase();return t in D?D[t]:t.startsWith(`proxy-`)?`proxying is configured on the browser`:t.startsWith(`sec-`)?`Sec- headers are reserved for the browser`:null}function se(e){for(let t of e){let e=oe(t.name);if(e)return{message:`curlwright: header "${t.name}" cannot be set from a page — ${e}`,exitCode:2}}return null}function O(e,t){let n=t.toLowerCase();return Object.keys(e).some(e=>e.toLowerCase()===n)}function k(e){let t={},n=new Set;for(let r of e.headers)if(r.name!==``){if(r.unset){n.add(r.name.toLowerCase());continue}t[r.name]=r.value}return{headers:t,suppressed:n}}function A(e,t,n){return!O(e,n)&&!t.has(n)}function j(e){return/^[a-zA-Z]+=/.test(e)?e:`bytes=${e}`}function M(e,t,n,r){n.user!==null&&A(e,t,`authorization`)&&(e.Authorization=`Basic ${btoa(n.user)}`),n.range!==null&&A(e,t,`range`)&&(e.Range=j(n.range)),r.contentType&&A(e,t,`content-type`)&&(e[`Content-Type`]=r.contentType),r.accept&&A(e,t,`accept`)&&(e.Accept=r.accept)}function N(e,t){if(t===``)return e;let[n,r]=P(e);return`${n}${n.includes(`?`)?`&`:`?`}${t}${r}`}function P(e){let t=e.indexOf(`#`);return t===-1?[e,``]:[e.slice(0,t),e.slice(t)]}function F(e,t){return e.requestMethod?e.requestMethod:e.head?`HEAD`:t?`POST`:`GET`}function I(e,t,n){let r=e.toUpperCase();return!t||r!==`GET`&&r!==`HEAD`?null:{message:`curlwright: ${n.requestMethod?`-X ${n.requestMethod}`:`-I`} cannot carry a request body — a page fetch rejects a ${r} with one. Drop the data, or use -G to send it as a query string.`,exitCode:2}}function L(e,t){if(e.url===null)return{message:`curlwright: no URL specified`,exitCode:2};let{headers:n,suppressed:r}=k(e),i=e.get&&t.bytes!==null,a=i?{...t,bytes:null,contentType:null}:t;M(n,r,e,a);let o=i?N(e.url,new TextDecoder().decode(t.bytes??new Uint8Array)):e.url,s=a.bytes!==null||a.form!==null,c=F(e,s),l=I(c,s,e);if(l)return l;let u={method:c,headers:n,credentials:e.credentials,responseType:`binary`};return a.form?u.body=a.form:a.bytes&&(u.body=a.bytes),e.referer!==null&&(u.referrer=e.referer),e.maxTimeSeconds!==null&&(u.timeoutMs=e.maxTimeSeconds*1e3),{url:o,method:c,fetchOptions:u,uploadSize:a.bytes?.length??0}}function R(e){let t=e.fetchOptions.headers??{},n=[`> ${e.method} ${e.url}`];for(let[e,r]of Object.entries(t))n.push(`> ${e}: ${r}`);return n.push(`> `),`${n.join(`
|
|
2
2
|
`)}\n`}function z(e,t){let n=[`< ${e}`];for(let[e,r]of Object.entries(t))n.push(`< ${e}: ${r}`);return n.push(`< `),`${n.join(`
|
|
3
3
|
`)}\n`}function B(t,n){return typeof t==`string`?n===`base64`?e(t):new TextEncoder().encode(t):new Uint8Array}function V(e,t){return t?`HTTP/1.1 ${e} ${t}`:`HTTP/1.1 ${e}`}function H(e,t,n){let r=[V(e,t)];for(let[e,t]of Object.entries(n))r.push(`${e}: ${t}`);return`${r.join(`\r
|
|
4
4
|
`)}\r\n\r\n`}function U(e){if(e.includes(0))return!0;try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(e),!1}catch{return!0}}function W(e){let t;try{t=new URL(e).pathname}catch{t=e.split(`?`)[0]}return t.replace(/\/+$/,``).split(`/`).pop()||null}function G(e,t,n){return new TextEncoder().encode(H(e,t,n)).length}function K(e){try{return new URL(e).origin}catch{return null}}function q(e){return e.map(e=>` --tab=${e.targetId} ${e.url}`).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./slicc-version-
|
|
1
|
+
import{n as e}from"./slicc-version-bYxfYms3.js";import{a as t}from"./just-bash-compat-B-SPHuh_.js";const n=`/dev/null`;function r(e){return e.oldName===n}function i(e){return e.newName===n}function a(e){let t=e.indexOf(` `);return(t===-1?e.replace(/\s+\d{4}-\d\d-\d\d[ T].*$/,``):e.slice(0,t)).trimEnd()}const o=/^@@+ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function s(e){let t=o.exec(e);return t?{oldStart:Number(t[1]),oldCount:t[2]===void 0?1:Number(t[2]),newStart:Number(t[3]),newCount:t[4]===void 0?1:Number(t[4])}:null}function c(e,t){return{...e,oldLines:[],newLines:[],oldSeen:0,newSeen:0,changeSeen:!1,leadingContext:0,trailingContext:0,lastSide:null,oldNoNewlineAtEof:!1,newNoNewlineAtEof:!1,raw:[t]}}function l(e){return{oldStart:e.oldStart,newStart:e.newStart,oldLines:e.oldLines,newLines:e.newLines,leadingContext:e.leadingContext,trailingContext:e.trailingContext,oldNoNewlineAtEof:e.oldNoNewlineAtEof,newNoNewlineAtEof:e.newNoNewlineAtEof,raw:e.raw}}function u(e){return e.oldSeen>=e.oldCount&&e.newSeen>=e.newCount}function d(e,t){e.oldLines.push(t),e.newLines.push(t),e.oldSeen++,e.newSeen++,e.lastSide=`both`,e.changeSeen?e.trailingContext++:e.leadingContext++}function f(e,t,n){t===`old`?(e.oldLines.push(n),e.oldSeen++):(e.newLines.push(n),e.newSeen++),e.lastSide=t,e.changeSeen=!0,e.trailingContext=0}function p(e,t){if(t.startsWith(`\\`))return(e.lastSide===`old`||e.lastSide===`both`)&&(e.oldNoNewlineAtEof=!0),(e.lastSide===`new`||e.lastSide===`both`)&&(e.newNoNewlineAtEof=!0),e.raw.push(t),!0;if(t===``)return d(e,``),e.raw.push(` `),!0;let n=t.slice(1);switch(t[0]){case` `:d(e,n);break;case`-`:f(e,`old`,n);break;case`+`:f(e,`new`,n);break;default:return!1}return e.raw.push(t),!0}function m(e){e.hunk&&e.current&&e.current.hunks.push(l(e.hunk)),e.hunk=null,e.complete=!1}function h(e,t){let n=e.hunk;if(!n)return!1;if(e.complete){let r=t.startsWith(`\\`);return r&&p(n,t),m(e),r}return p(n,t)?(u(n)&&(e.complete=!0),!0):(m(e),!1)}function g(e){let t={files:[],current:null,hunk:null,complete:!1,pendingOld:null};for(let n of e.split(`
|
|
2
2
|
`)){if(h(t,n))continue;if(n.startsWith(`--- `)){t.pendingOld=a(n.slice(4));continue}if(n.startsWith(`+++ `)&&t.pendingOld!==null){t.current={oldName:t.pendingOld,newName:a(n.slice(4)),hunks:[]},t.files.push(t.current),t.pendingOld=null;continue}t.pendingOld=null;let e=s(n);e&&t.current&&(t.hunk=c(e,n))}return m(t),t.files.filter(e=>e.hunks.length>0)}function _(e){return{oldName:e.newName,newName:e.oldName,hunks:e.hunks.map(e=>({oldStart:e.newStart,newStart:e.oldStart,oldLines:e.newLines,newLines:e.oldLines,leadingContext:e.leadingContext,trailingContext:e.trailingContext,oldNoNewlineAtEof:e.newNoNewlineAtEof,newNoNewlineAtEof:e.oldNoNewlineAtEof,raw:v(e)}))}}function v(e){return e.raw.map((t,n)=>n===0?`@@ -${e.newStart},${e.newLines.length} +${e.oldStart},${e.oldLines.length} @@`:t.startsWith(`-`)?`+${t.slice(1)}`:t.startsWith(`+`)?`-${t.slice(1)}`:t)}function y(e){if(e===``)return{lines:[],newlineAtEof:!0};let t=e.endsWith(`
|
|
3
3
|
`),n=e.split(`
|
|
4
4
|
`);return t&&n.pop(),{lines:n,newlineAtEof:t}}function b(e){return e.lines.length===0?``:e.lines.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./record-ChU1ND2B.js";import{t,u as n}from"./descriptor-S4Jug1iP.js";import{t as r}from"./subcommand-flags-BZi7j78Q.js";import{t as i}from"./subcommand-help-CgO7wRS5.js";import{a,r as o,t as s}from"./memory-budget-Bcf7Eolo.js";import{d as c}from"./kernel-worker-
|
|
1
|
+
import{t as e}from"./record-ChU1ND2B.js";import{t,u as n}from"./descriptor-S4Jug1iP.js";import{t as r}from"./subcommand-flags-BZi7j78Q.js";import{t as i}from"./subcommand-help-CgO7wRS5.js";import{a,r as o,t as s}from"./memory-budget-Bcf7Eolo.js";import{d as c}from"./kernel-worker-Bq9IjFw5.js";const l=`usage: memory <command> [options]
|
|
2
2
|
|
|
3
3
|
Durable cone memory: one file per cone, rewritten by the memory-curator
|
|
4
4
|
scoop after a chat freezes. This command inspects that system and pokes it.
|
|
@@ -38,7 +38,7 @@ Examples:
|
|
|
38
38
|
memory log --limit 5
|
|
39
39
|
memory curate --archive 2026-09-11T08-30-00Z-fix-build.md
|
|
40
40
|
memory dream --all
|
|
41
|
-
`,u=[`--cone`,`--archive`,`--limit`];function d(e){return{stdout:e,stderr:``,exitCode:0}}function f(e){return{stdout:``,stderr:`memory: ${e}\n`,exitCode:1}}function p(){let e=globalThis.__slicc_memory;return e&&typeof e.curate==`function`&&typeof e.dream==`function`?e:null}async function m(){let{isMemoryV2Enabled:e}=await import(`./memory-v2-flag-
|
|
41
|
+
`,u=[`--cone`,`--archive`,`--limit`];function d(e){return{stdout:e,stderr:``,exitCode:0}}function f(e){return{stdout:``,stderr:`memory: ${e}\n`,exitCode:1}}function p(){let e=globalThis.__slicc_memory;return e&&typeof e.curate==`function`&&typeof e.dream==`function`?e:null}async function m(){let{isMemoryV2Enabled:e}=await import(`./memory-v2-flag-DK0lPu0X.js`);return!e()}async function h(e,t){try{let n=await e.readFile(t,{encoding:`utf-8`});return typeof n==`string`?n:new TextDecoder().decode(n)}catch{return null}}async function g(n){let r=[e];try{let e=await n.readDir(t);for(let t of e)t.type===`directory`&&r.push(t.name)}catch{}return r}function _(e){return n({parentJid:null,folder:e}).memoryPath}async function v(e,t){let n=await g(e);return n.includes(t)?{folder:t}:{error:`unknown cone "${t}" (cones: ${n.join(`, `)})`}}function y(e){return e.memoryFailed===void 0?e.memoryPending?`pending`:e.memoryCuratedAt===void 0?e.memorySkipped?`skipped`:`none`:`curated`:`failed`}async function b(e,t){let n=r(e,{value:[`--cone`]});if(`error`in n)return f(n.error);let i=await v(t,n.values.get(`--cone`)??`cone`);if(`error`in i)return f(i.error);let a=_(i.folder),o=await h(t,a);return o===null?f(`no memory file at ${a}`):d(o.endsWith(`
|
|
42
42
|
`)||o===``?o:`${o}\n`)}const x=`/sessions/.curation/health.json`;async function S(e){let t=await h(e,x);if(t===null)return null;try{let e=JSON.parse(t);return typeof e.at!=`string`||!Array.isArray(e.failures)?null:{at:e.at,failures:e.failures.map(String)}}catch{return null}}async function C(e){let t=await c(e),n=[];for(let t of await g(e)){let r=_(t),i=await h(e,r);n.push({folder:t,path:r,chars:i===null?null:i.length})}let r={curated:0,failed:0,pending:0,skipped:0,none:0},i=new Map;for(let e of t){let t=y(e);if(r[t]++,t===`curated`){let t=e.cone??`cone`;i.set(t,(i.get(t)??0)+1)}}let l=[];r.failed>0&&l.push(`${r.failed} archive(s) whose last curation attempt failed — see \`memory log\``);for(let t of s)await h(e,t)!==null&&l.push(`${t} is no longer read — memory instructions live in ${o}; carry any customization over, then delete it`);for(let e of n){let t=i.get(e.folder)??0;t===0||(e.chars??0)>0||l.push(e.folder===`cone`?`${t} archive(s) report successful curation but the primary memory file is missing or empty`:`${t} archive(s) from cone "${e.folder}" report successful curation but its memory file (${e.path}) is missing or empty`)}return{memoryV2:!await m(),sessions:t.length,budgetChars:a(t.length),cones:n,curation:r,checks:l,scheduledCheck:await S(e)}}async function w(e,t){let n=r(e,{bool:[`--json`,`--check`]});if(`error`in n)return f(n.error);let i=await C(t),a=n.bools.has(`--check`)&&i.checks.length>0;if(n.bools.has(`--json`))return{stdout:`${JSON.stringify(i,null,2)}\n`,stderr:``,exitCode:+!!a};let o=`Memory v2: ${i.memoryV2?`ON`:`OFF — curation surfaces beyond the freezer pass are disabled`}\n`;o+=`Sessions: ${i.sessions} archived (memory budget ${i.budgetChars} chars)\n`,o+=`Memory files:
|
|
43
43
|
`;for(let e of i.cones){let t=e.chars===null?`missing`:`${e.chars} chars`;o+=` ${e.folder.padEnd(14)}${e.path} (${t})\n`}let{curated:s,failed:c,pending:l,skipped:u,none:d}=i.curation;if(o+=`Curation: ${s} curated, ${c} failed, ${l} pending, ${u} skipped, ${d} unmarked\n`,i.checks.length>0){o+=`Health:
|
|
44
44
|
`;for(let e of i.checks)o+=` FAIL ${e}\n`}else o+=`Health: ok
|
|
@@ -42,7 +42,7 @@ Examples:
|
|
|
42
42
|
gelatiere suggest "$TMPDIR/candidates.json" && gelatiere deliver
|
|
43
43
|
gelatiere dismiss skill-github
|
|
44
44
|
gelatiere use-cases --limit 3 --json
|
|
45
|
-
`,i=[`--scoop`],a=[`--limit`],o=[...i,...a];function s(e){return{stdout:e,stderr:``,exitCode:0}}function c(e){return{stdout:``,stderr:`gelatiere: ${e}\n`,exitCode:1}}const l=`kernel host has not booted yet — try again in a moment`;function u(){let e=globalThis.__slicc_gelatiere;return e&&typeof e.roots==`function`?e:null}function d(){return import(`./gelatiere-store-
|
|
45
|
+
`,i=[`--scoop`],a=[`--limit`],o=[...i,...a];function s(e){return{stdout:e,stderr:``,exitCode:0}}function c(e){return{stdout:``,stderr:`gelatiere: ${e}\n`,exitCode:1}}const l=`kernel host has not booted yet — try again in a moment`;function u(){let e=globalThis.__slicc_gelatiere;return e&&typeof e.roots==`function`?e:null}function d(){return import(`./gelatiere-store-D_JKXdpV.js`)}async function f(t,n){let r=e(t,{bool:[`--reset`]});if(`error`in r)return c(r.error);let i=u();if(!i)return c(l);let a=await(await d()).loadGelatiereConfig(n),o=``;if(r.bools.has(`--reset`)){let e=await i.unregisterOwned();o=e.length?`Dropped ${e.length} gelatiere unit(s): ${e.join(`, `)}\n`:``}let f;try{f=await i.ensureUnit(a.allowedCommands)}catch(e){return c(e instanceof Error?e.message:String(e))}let m=await i.ensureNightly(a.nightly);return s(o+`${f.created?`Created`:`Found`} the gelatiere (${f.jid}, folder ${f.folder})\n`+p(f.allowList)+`${m.created?`Registered`:`Found`} nightly pass: cron "${m.cron}" (${m.id})\nSuggestions render in the suggestions card; \`gelatiere run\` asks for a pass now.
|
|
46
46
|
`)}function p(e){return e===`updated`?`Updated its command allow-list from GELATIERE.md
|
|
47
47
|
`:e===`deferred`?`Left its command allow-list alone: the gelatiere is mid-pass and applying it would
|
|
48
48
|
cancel the pass — run \`gelatiere init\` again once it is idle
|
|
@@ -50,5 +50,5 @@ cancel the pass — run \`gelatiere init\` again once it is idle
|
|
|
50
50
|
`),s(l)}async function g(t,n){let r=e(t,{value:i,bool:[`--force`]});if(`error`in r)return c(r.error);let a=u();if(!a)return c(l);let o=await d(),f=await o.readGelatiereSuggestions(n),p=o.openSuggestions(f),m=await o.readGelatiereState(n);if(o.suggestionsSince(f,m.lastDeliveredAt).length===0&&!r.bools.has(`--force`))return s(`Nothing new since the last delivery; no lick sent (use --force to resend).
|
|
51
51
|
`);let h=a.roots();if(h.length===0)return c(`no cone is running to deliver to`);let g=r.values.get(`--scoop`),v=g?h.find(e=>e.folder===g||e.name===g||e.jid===g):void 0;if(g&&!v)return c(`unknown delivery target "${g}" (cones: ${h.map(e=>e.folder).join(`, `)})`);let y=await _(a,h,v?[v]:h,{since:m.lastDeliveredAt,open:p,force:r.bools.has(`--force`),alias:g});g||await o.writeGelatiereState(n,{...m,lastDeliveredAt:new Date().toISOString()});let b=g?` (targeted; the delivery watermark is unchanged)`:``;return y.length===0?s(`Nothing addressed to ${g??`any running cone`}; no lick sent${b}\n`):s(`Delivered to ${y.length} cone(s): ${y.join(`, `)}${b}\n`)}async function _(e,t,n,r){let i=await d(),a=new Set(t.map(e=>e.folder)),o=t[0].folder,s=[];for(let t of n){let n=i.suggestionsForCone(r.open,t.folder,o,a),c=n.filter(e=>i.isNewSince(e,r.since,t.folder));if(c.length===0&&!(r.force&&n.length>0))continue;let l=r.alias??t.folder;e.lick(l,i.buildGelatiereLickBody(c,n)),s.push(`${l} (${c.length} new, ${n.length} open)`)}return s}async function v(t,n){let r=e(t,{bool:[`--all`,`--json`]});if(`error`in r)return c(r.error);let i=await d(),a=await i.readGelatiereSuggestions(n),o=r.bools.has(`--all`)?a:i.openSuggestions(a);if(r.bools.has(`--json`))return s(`${JSON.stringify(o,null,2)}\n`);if(o.length===0)return s(a.length===0?"No suggestions yet. `gelatiere run` asks for a pass now.\n":"No open suggestions (every one has been taken or dismissed; `--all` lists them).\n");let l=``;for(let e of o){let t=e.dismissedAt?` (dismissed)`:e.takenAt?` (taken)`:``;l+=`${e.id} [${e.kind}]${t}\n ${e.title}\n`,e.install&&(l+=` install: ${e.install}\n`),e.prompt&&(l+=` try: ${e.prompt}\n`)}return s(l)}async function y(e,t){let n=e[0];return n?await(await d()).dismissGelatiereSuggestion(t,n)?s(`Dismissed ${n}.\n`):c(`no open suggestion with id "${n}"`):c("dismiss requires a suggestion id (see `gelatiere list`)")}const b=`https://www.sliccy.com`,x=512e3,S=/^[a-z0-9][a-z0-9-]*$/;async function C(e,t){let n=await fetch(`${b}${e}`,{signal:AbortSignal.timeout(15e3)});if(!n.ok)throw Error(`${e}: HTTP ${n.status}`);let r=await n.text();return r.length>t?r.slice(0,t):r}async function w(){try{let e=await C(`/skills/catalog.json`,x);return s(e.endsWith(`
|
|
52
52
|
`)?e:`${e}\n`)}catch(e){return c(`catalog fetch failed: ${e instanceof Error?e.message:String(e)}`)}}async function T(){try{let e=[...(await C(`/sitemap.xml`,x)).matchAll(/<loc>[^<]*\/man\/([a-z0-9-]+)(?:\.html)?<\/loc>/g)].map(e=>e[1]).sort();return e.length===0?c(`no man pages found in the sitemap`):s(`${[...new Set(e)].join(` `)}\n`)}catch(e){return c(`sitemap fetch failed: ${e instanceof Error?e.message:String(e)}`)}}async function E(e){let t=e[0];if(!t)return c(`man requires a command name: gelatiere man <command>`);if(!S.test(t))return c(`not a command name: "${t}"`);try{let e=await C(`/man/${t}.plain.html`,16e3);return s(e.endsWith(`
|
|
53
|
-
`)?e:`${e}\n`)}catch(e){return c(`man fetch failed: ${e instanceof Error?e.message:String(e)}`)}}function D(e,t,n){let r=e=>{let t=n.match(RegExp(`<meta[^>]+name=["']${e}["'][^>]+content=(["'])((?:(?!\\1).)*)\\1`,`i`));return t?k(t[2]).trim():``},i=n.match(/<title[^>]*>([^<]*)<\/title>/i);return{slug:e,url:t,title:i?k(i[1]).trim():A(e),description:r(`description`),skills:r(`slicc-upskill`).split(`,`).map(e=>e.trim()).filter(Boolean)}}const O={amp:`&`,lt:`<`,gt:`>`,quot:`"`,"#39":`'`,"#x27":`'`};function k(e){return e.replace(/&(#x?[0-9a-fA-F]+|[a-z]+);/g,(e,t)=>{let n=O[t.toLowerCase()];if(n)return n;let r=t.match(/^#(x?)([0-9a-fA-F]+)$/i);if(!r)return e;let i=Number.parseInt(r[2],r[1]?16:10);return Number.isFinite(i)?String.fromCodePoint(i):e})}function A(e){let t=e.replace(/-/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function j(e,t){return e<=0?0:Math.floor(t/864e5)%e}function M(e,t,n){if(t>=e.length)return[...e];let r=j(e.length,n);return Array.from({length:t},(t,n)=>e[(r+n)%e.length])}async function N(e,t){let n=Array(e.length),r=0,i=async()=>{for(;r<e.length;){let i=r++;n[i]=await t(e[i])}};return await Promise.all(Array.from({length:Math.min(4,e.length)},()=>i())),n}async function P(t){let n=e(t,{value:a,bool:[`--json`]});if(`error`in n)return c(n.error);let r=n.values.get(`--limit`),i=r===void 0?12:Number(r);if(!Number.isInteger(i)||i<=0)return c(`--limit must be a positive whole number, not "${r}"`);let o;try{let e=await C(`/sitemap.xml`,x);o=[...new Set([...e.matchAll(/<loc>[^<]*\/use-cases\/([a-z0-9-]+)(?:\.html)?<\/loc>/g)].map(e=>e[1]))].sort()}catch(e){return c(`sitemap fetch failed: ${e instanceof Error?e.message:String(e)}`)}if(o.length===0)return c(`no use cases found in the sitemap`);let l=await N(M(o,Math.min(i,12),Date.now()),async e=>{let t=`${b}/use-cases/${e}`;try{return D(e,t,await C(`/use-cases/${e}`,24e3))}catch{return{slug:e,url:t,title:A(e),description:``,skills:[]}}});if(n.bools.has(`--json`))return s(`${JSON.stringify(l,null,2)}\n`);let u=``;for(let e of l)u+=`${e.slug}\t${e.title}\n ${e.url}\n`,e.description&&(u+=` ${e.description}\n`),e.skills.length&&(u+=` skills: ${e.skills.join(` `)}\n`);return s(u)}async function F(e){let t=await d(),n=u(),r=n?.unit(),i=await t.loadGelatiereConfig(e),a=await t.readGelatiereState(e),o=await t.readGelatiereSuggestions(e),c=``,{isMemoryV2Enabled:l}=await import(`./memory-v2-flag-
|
|
53
|
+
`)?e:`${e}\n`)}catch(e){return c(`man fetch failed: ${e instanceof Error?e.message:String(e)}`)}}function D(e,t,n){let r=e=>{let t=n.match(RegExp(`<meta[^>]+name=["']${e}["'][^>]+content=(["'])((?:(?!\\1).)*)\\1`,`i`));return t?k(t[2]).trim():``},i=n.match(/<title[^>]*>([^<]*)<\/title>/i);return{slug:e,url:t,title:i?k(i[1]).trim():A(e),description:r(`description`),skills:r(`slicc-upskill`).split(`,`).map(e=>e.trim()).filter(Boolean)}}const O={amp:`&`,lt:`<`,gt:`>`,quot:`"`,"#39":`'`,"#x27":`'`};function k(e){return e.replace(/&(#x?[0-9a-fA-F]+|[a-z]+);/g,(e,t)=>{let n=O[t.toLowerCase()];if(n)return n;let r=t.match(/^#(x?)([0-9a-fA-F]+)$/i);if(!r)return e;let i=Number.parseInt(r[2],r[1]?16:10);return Number.isFinite(i)?String.fromCodePoint(i):e})}function A(e){let t=e.replace(/-/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}function j(e,t){return e<=0?0:Math.floor(t/864e5)%e}function M(e,t,n){if(t>=e.length)return[...e];let r=j(e.length,n);return Array.from({length:t},(t,n)=>e[(r+n)%e.length])}async function N(e,t){let n=Array(e.length),r=0,i=async()=>{for(;r<e.length;){let i=r++;n[i]=await t(e[i])}};return await Promise.all(Array.from({length:Math.min(4,e.length)},()=>i())),n}async function P(t){let n=e(t,{value:a,bool:[`--json`]});if(`error`in n)return c(n.error);let r=n.values.get(`--limit`),i=r===void 0?12:Number(r);if(!Number.isInteger(i)||i<=0)return c(`--limit must be a positive whole number, not "${r}"`);let o;try{let e=await C(`/sitemap.xml`,x);o=[...new Set([...e.matchAll(/<loc>[^<]*\/use-cases\/([a-z0-9-]+)(?:\.html)?<\/loc>/g)].map(e=>e[1]))].sort()}catch(e){return c(`sitemap fetch failed: ${e instanceof Error?e.message:String(e)}`)}if(o.length===0)return c(`no use cases found in the sitemap`);let l=await N(M(o,Math.min(i,12),Date.now()),async e=>{let t=`${b}/use-cases/${e}`;try{return D(e,t,await C(`/use-cases/${e}`,24e3))}catch{return{slug:e,url:t,title:A(e),description:``,skills:[]}}});if(n.bools.has(`--json`))return s(`${JSON.stringify(l,null,2)}\n`);let u=``;for(let e of l)u+=`${e.slug}\t${e.title}\n ${e.url}\n`,e.description&&(u+=` ${e.description}\n`),e.skills.length&&(u+=` skills: ${e.skills.join(` `)}\n`);return s(u)}async function F(e){let t=await d(),n=u(),r=n?.unit(),i=await t.loadGelatiereConfig(e),a=await t.readGelatiereState(e),o=await t.readGelatiereSuggestions(e),c=``,{isMemoryV2Enabled:l}=await import(`./memory-v2-flag-DK0lPu0X.js`);l()||(c+=`Memory v2: OFF — the nightly is unscheduled and session ends do not trigger passes
|
|
54
54
|
`),c+=`Unit: ${r?`${r.jid} (folder ${r.folder})`:"not created — run `gelatiere init`"}\n`;let f=n?.nightly();return c+=`Nightly: ${f?`registered, cron "${f.cron}" (${f.id})`:`not registered — run \`gelatiere init\` (cron "${i.nightly}")`}\n`,c+=`Interval: ${i.intervalHours}h between session-end passes\n`,c+=I(i.allowedCommands,n?.unitAllowedCommands(),t),c+=`Passes: ${a.passes}\n`,c+=`Last pass: ${a.lastPassAt??`never`}\n`,c+=`Last trigger: ${a.lastTriggeredAt??`never`}\n`,c+=`Last delivery: ${a.lastDeliveredAt??`never`}\n`,c+=`Suggestions: ${t.openSuggestions(o).length} open, ${t.takenSuggestions(o).length} taken, ${o.length} total\n`,s(c)}function I(e,t,n){let r=e=>{let t=e.filter(e=>!n.GELATIERE_BASE_ALLOWED_COMMANDS.includes(e));return t.length?` (+${t.join(`, `)} from GELATIERE.md)`:``};return t?t.length===e.length&&t.every((t,n)=>t===e[n])?`Commands: ${t.length} allowed without approval${r(t)}\n`:`Commands: ${t.length} in force${r(t)}; GELATIERE.md asks for ${e.length}${r(e)} — run \`gelatiere init\`\n`:`Commands: ${e.length} configured${r(e)}, pending — run \`gelatiere init\`\n`}async function L(e,n,i){let a=e[0];if(!a||t(e,{valueFlags:o}))return s(r);let l=e.slice(1);switch(a){case`init`:return f(l,i.fs);case`run`:return m(n.env);case`suggest`:return h(l,i.fs);case`deliver`:return g(l,i.fs);case`list`:return v(l,i.fs);case`dismiss`:return y(l,i.fs);case`status`:return F(i.fs);case`catalog`:return w();case`commands`:return T();case`man`:return E(l);case`use-cases`:return P(l);default:return c(`unknown command: ${a}\n${r}`)}}export{L as runGelatiere};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./panel-rpc-BPwAqRch.js";import{n as t,t as n}from"./screencapture-media-shared-DlK1Wqh8.js";function r(e){return`screen:${e}`}const i={screenshot:!0,text:!1,frames:`poll`,keyboard:!1,mouse:`none`,scroll:!1,exec:!1,inputAllowed:!1};function a(e){return e.includes(`png`)?`image/png`:`image/jpeg`}function o(e){return new Uint8Array(e)}function s(e){if(typeof e!=`object`||!e)return null;let t=Object.getOwnPropertyDescriptor(e,`handle`)?.value;return typeof t==`string`?t:null}var c=class{rpc;handle;onGone;seq=0;title;size;state=`live`;offEnded;constructor(e,t,r={title:t},i){this.rpc=e,this.handle=t,this.onGone=i,this.title=r.title,this.size=r.width&&r.height&&r.width>0&&r.height>0?{width:r.width,height:r.height}:null,this.offEnded=e.onEvent?e.onEvent(n,e=>{s(e)===this.handle&&this.markGone()}):()=>void 0}describe(){return{id:r(this.handle),kind:`screen`,title:this.title,size:this.size,state:this.state,capabilities:i,pid:null}}async screenshot(e){let t;try{t=await this.rpc.call(`screencapture`,{mimeType:e.format===`png`?`image/png`:`image/jpeg`,quality:.7,mode:`session`,session:`frame`,handle:this.handle,maxWidth:e.maxWidth})}catch(e){throw(e instanceof Error?e.message:String(e)).includes(`no screen-share session`)&&this.markGone(),e}return t.width>0&&t.height>0&&(this.size={width:t.width,height:t.height}),this.seq+=1,{seq:this.seq,mime:a(t.mimeType),width:t.width,height:t.height,bytes:o(t.bytes)}}async input(e){throw Error(`input is not allowed`)}async recordClip(n){let r=t(n),i=await this.rpc.call(`screencapture`,{mimeType:`video/webm`,quality:1,mode:`session`,session:`record`,handle:this.handle,durationMs:r},{timeoutMs:r+e});return{bytes:o(i.bytes),mime:i.mimeType||`video/webm`,width:i.width,height:i.height,...i.durationMs===void 0?{}:{durationMs:i.durationMs}}}async close(){this.offEnded();try{await this.rpc.call(`screencapture`,{mimeType:`application/octet-stream`,quality:1,mode:`session`,session:`stop`,handle:this.handle})}catch{}}markGone(){this.state!==`gone`&&(this.state=`gone`,this.onGone?.())}};export{c as BridgedScreenComputerBackend,r as screenComputerId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new Set,t=!1,n;function r(e){if(typeof e!=`object`||!e)return!1;let t=Object.getOwnPropertyDescriptor(e,`type`)?.value,n=Object.getOwnPropertyDescriptor(e,`id`)?.value;return(t===`begin`||t===`end`)&&typeof n==`string`}function i(n){t=!0,n.type===`begin`?e.add(n.id):e.delete(n.id)}function a(){if(n===void 0){if(typeof BroadcastChannel!=`function`){n=null;return}try{n=new BroadcastChannel(`slicc-screen-share-approval`)}catch{n=null;return}n.onmessage=e=>{r(e.data)&&i(e.data)}}}function o(){return a(),e.size>0||!t}function s(e,t){return o()?!0:(t(e),!1)}export{s as keepAdoptedScreenShare,a as listenScreenShareApprovalChannel};
|