sliccy 6.199.0 → 6.199.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/.vite/manifest.json +186 -186
- package/dist/ui/assets/{account-store-EoBfJmnP.js → account-store-BQYiWjX3.js} +1 -1
- package/dist/ui/assets/{account-store-Cx-zMFBD.js → account-store-CsQmcosC.js} +1 -1
- package/dist/ui/assets/{adobe-D4lN-fe9.js → adobe-CFiTrnEz.js} +1 -1
- package/dist/ui/assets/{adobe-DNks8ueK.js → adobe-DUs3iNpw.js} +1 -1
- package/dist/ui/assets/{agent-panels-DfH2RfRc.js → agent-panels-DEuOP-Su.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-CJIpcyA_.js → almost-bash-shell-headless-DUJ1lI3T.js} +31 -31
- package/dist/ui/assets/{apply-layout-ycn-YWV8.js → apply-layout-17wmvpy6.js} +1 -1
- package/dist/ui/assets/{apps-CwMp0IaY.js → apps-D_FfUPg-.js} +1 -1
- package/dist/ui/assets/{azure-openai--kdMGYQe.js → azure-openai-Bsm_KGZc.js} +1 -1
- package/dist/ui/assets/{azure-openai-2XjV814_.js → azure-openai-xk7_poPJ.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-DmwXuxc_.js → backend-hostfs-eD_azRLB.js} +1 -1
- package/dist/ui/assets/{cdp-C8iHjGeB.js → cdp-GwESLUdR.js} +1 -1
- package/dist/ui/assets/{cerebras-Bj8IbswC.js → cerebras-76AY807L.js} +1 -1
- package/dist/ui/assets/{cerebras-B2MfjfTb.js → cerebras-tvTwxkd4.js} +1 -1
- package/dist/ui/assets/{composer-speech-B7jpqEUd.js → composer-speech-Cxn1TcIJ.js} +1 -1
- package/dist/ui/assets/{connect-surface-Dsv-VRdA.js → connect-surface-DUFSKgU_.js} +1 -1
- package/dist/ui/assets/{directed-approval-BY11fbfk.js → directed-approval-7_qI5Fn9.js} +1 -1
- package/dist/ui/assets/{emscripten-vfs-hook-rDtZMlJd.js → emscripten-vfs-hook-CmuMXI3w.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-Bnwq1rHN.js → ensure-speech-assets-DTXTVJng.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-SpOL-8Rw.js → frozen-archive-writer-BvN59S-x.js} +1 -1
- package/dist/ui/assets/{fs-j0imIjve.js → fs-C7oRuyTC.js} +2 -2
- package/dist/ui/assets/{fs-COFN8LYS.js → fs-CSXuJafL.js} +1 -1
- package/dist/ui/assets/{gelatiere-store-DMxpxFl5.js → gelatiere-store-DaOfYbsi.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-BVxUEyjY.js → gelatiere-unit-CP3l39UW.js} +1 -1
- package/dist/ui/assets/{github-CP2HmcKt.js → github-DELmM1a9.js} +2 -2
- package/dist/ui/assets/{github-BBpjYbca.js → github-DbhHC_fq.js} +1 -1
- package/dist/ui/assets/{github-auth-BGeZvDDK.js → github-auth-CzBLV9g_.js} +1 -1
- package/dist/ui/assets/{github-copilot-C8HzPVks.js → github-copilot-DTIfFrg_.js} +1 -1
- package/dist/ui/assets/{github-copilot-z_3tgxne.js → github-copilot-sSXlI5Hl.js} +1 -1
- package/dist/ui/assets/{github-install-BuHsKLmH.js → github-install-BCFfvAe2.js} +1 -1
- package/dist/ui/assets/{github-zip-CdhraPsW.js → github-zip-BJkh1FPE.js} +1 -1
- package/dist/ui/assets/{hear-B3_6gBpO.js → hear-BOTprDJu.js} +1 -1
- package/dist/ui/assets/{help-DEBF1lg7.js → help-CPJ8dRbw.js} +1 -1
- package/dist/ui/assets/{installer-CRB9PB6D.js → installer-B1DgYJv5.js} +1 -1
- package/dist/ui/assets/{ipk-mamba-DWCiJ0YO.js → ipk-mamba-B0FFCDpT.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-9qNmSeMt.js → js-realm-worker-CmRJi0fU.js} +2 -2
- package/dist/ui/assets/{jsh-executor-Bv_veUM_.js → jsh-executor-CPKLmDKX.js} +2 -2
- package/dist/ui/assets/{kernel-worker-B_7I-3sG.js → kernel-worker-iJeImuDy.js} +9 -9
- package/dist/ui/assets/{lick-ws-bridge-5HuXfp92.js → lick-ws-bridge-1UU2aah-.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-BJwcfwUG.js → lick-ws-bridge-Bsmd0ic8.js} +1 -1
- package/dist/ui/assets/{live-session-curation-BFmvB-0m.js → live-session-curation-MORSNU9i.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-BzqcwvnN.js → live-session-snapshot-CZyTTSH9.js} +1 -1
- package/dist/ui/assets/{local-llm-B-rO-waH.js → local-llm-B3ZoRhOh.js} +1 -1
- package/dist/ui/assets/{local-llm-CbMyPbKh.js → local-llm-DFZMKK35.js} +1 -1
- package/dist/ui/assets/{main-A0IDHjYB.js → main-CuBg8Fva.js} +3 -3
- package/dist/ui/assets/{main-cherry-BjDYCEBf.js → main-cherry-C_B0O2HI.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-DpIeuHCo.js → memory-curation-seam-ku33C875.js} +1 -1
- package/dist/ui/assets/{memory-health-DCVHFlpU.js → memory-health-DHAxwmb-.js} +1 -1
- package/dist/ui/assets/{memory-write-execute-CCRzz7oL.js → memory-write-execute-CggTzg5q.js} +1 -1
- package/dist/ui/assets/{merge-folded-cost-into-frozen-DAmJAikz.js → merge-folded-cost-into-frozen-BGkyiwsq.js} +1 -1
- package/dist/ui/assets/{mount-CyPrJ0Dn.js → mount-BlziI0mJ.js} +1 -1
- package/dist/ui/assets/{mount-DajU3MBA.js → mount-DMRlGyGP.js} +3 -3
- package/dist/ui/assets/{new-session-DqnJYTgI.js → new-session-CuCWlqws.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-6HPPzWmI.js → oauth-bootstrap-Bs5DqiiC.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-CgakRFkk.js → onboarding-orchestrator-D6tlpH7o.js} +1 -1
- package/dist/ui/assets/{openai-codex-bVm3p-UR.js → openai-codex-Bmh3EaeT.js} +1 -1
- package/dist/ui/assets/{openai-codex-DKHDJx7V.js → openai-codex-Dd-sQeFy.js} +1 -1
- package/dist/ui/assets/{openrouter-axjw9vxd.js → openrouter-BPH4grX7.js} +1 -1
- package/dist/ui/assets/{openrouter-imALD05G.js → openrouter-GbbLrszS.js} +1 -1
- package/dist/ui/assets/{openrouter-free-ZOjmQipE.js → openrouter-free-Cr6v3avz.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DoT4iD1_.js → openrouter-free-ncOUJayQ.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-CL-Mvzf2.js → openrouter-oauth-BZ2HRnOs.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-tL5bQcLP.js → openrouter-oauth-D-CaztBn.js} +1 -1
- package/dist/ui/assets/{opfs-mount-Bh50Ihzc.js → opfs-mount-CMhjBiLh.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-SJZUazHr.js → panel-rpc-handlers-CisFES8Z.js} +2 -2
- package/dist/ui/assets/{panelize-shell-CMNQNMKL.js → panelize-shell-e4RbTduW.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-DdqXe8fR.js → pi-edit-execution-DBq4XyGl.js} +1 -1
- package/dist/ui/assets/{provider-BJWASjRb.js → provider-BKs9CsfU.js} +1 -1
- package/dist/ui/assets/{provider-BY7JJQ6C.js → provider-F10cdzxh.js} +2 -2
- package/dist/ui/assets/{provider-settings-CpxxDUGX.js → provider-settings-BAFwI4WB.js} +1 -1
- package/dist/ui/assets/provider-store-access-1Kmd9Ja4.js +1 -0
- package/dist/ui/assets/provider-store-access-J7a50AWP.js +1 -0
- package/dist/ui/assets/{providers-Bdna_Mfl.js → providers-B-aKQUHl.js} +2 -2
- package/dist/ui/assets/{providers-Cu9hF00M.js → providers-BHHpCtcj.js} +1 -1
- package/dist/ui/assets/{quick-llm-yC5FFRut.js → quick-llm-T5kFG3zg.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-mlxB_Jft.js → realm-inprocess-D3sJaVnO.js} +2 -2
- package/dist/ui/assets/{realm-unhandled-rejections-DTlyLSbk.js → realm-unhandled-rejections-DM29XBv5.js} +1 -1
- package/dist/ui/assets/{realm-unhandled-rejections-pcAKQKxI.js → realm-unhandled-rejections-Rf1v0rEB.js} +1 -1
- package/dist/ui/assets/{recovery-screen-VOpbkVaX.js → recovery-screen-DOSHXnLH.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-DCbE72Di.js → remote-terminal-view-D_ameeom.js} +2 -2
- package/dist/ui/assets/{restore-INu3JzKu.js → restore-CdVHVih3.js} +1 -1
- package/dist/ui/assets/{run-B8XEuF9O.js → run-6k6pQcEe.js} +1 -1
- package/dist/ui/assets/{run-xIOKpcaY.js → run-B-jRxYNq.js} +2 -2
- package/dist/ui/assets/{run-rx7i3htt.js → run-BCk9I-td.js} +2 -2
- package/dist/ui/assets/{run-C2U8vrlj.js → run-BFNlKi_A.js} +1 -1
- package/dist/ui/assets/{run-CKXEa8SO.js → run-B_h9dk2T.js} +1 -1
- package/dist/ui/assets/{run-B299BzVX.js → run-DBtyhE88.js} +1 -1
- package/dist/ui/assets/{session-command-memory-CIlH12-t.js → session-command-memory-MecK0_iM.js} +2 -2
- package/dist/ui/assets/{session-jsonl-DfIHsO8b.js → session-jsonl-BKkqFwP-.js} +1 -1
- package/dist/ui/assets/{session-jsonl-CbRjD436.js → session-jsonl-CDM_MXj9.js} +1 -1
- package/dist/ui/assets/{session-search-index-Dy-PfRqQ.js → session-search-index-DIon4isr.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-CR7KSNE7.js → setup-feature-flags-remote-DdIMImfS.js} +1 -1
- package/dist/ui/assets/{setup-model-catalog-DXEif6eM.js → setup-model-catalog-DDKN7ttZ.js} +1 -1
- package/dist/ui/assets/{signed-fetch-By29jUjE.js → signed-fetch-DCg1T80I.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-CNtrArsp.js → silent-renew-backoff-Bcv257pm.js} +1 -1
- package/dist/ui/assets/slicc-version-BMxOs5kP.js +1 -0
- package/dist/ui/assets/{snapshot-DGKjtXNh.js → snapshot-B8xhdpDw.js} +1 -1
- package/dist/ui/assets/{snapshot-features-DzVoIfFL.js → snapshot-features-CTe9oU5o.js} +1 -1
- package/dist/ui/assets/{soundscape-CnOrBnbw.js → soundscape-CrUTio-z.js} +1 -1
- package/dist/ui/assets/{speak-BloUZd1x.js → speak-DADyUtj4.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-IklvIg9J.js → sprinkle-manager-BM9fdO-q.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-B66ykiYM.js → sprinkle-renderer-cXRtUTYp.js} +1 -1
- package/dist/ui/assets/{state--dO2CNjQ.js → state-C0-ygS-7.js} +1 -1
- package/dist/ui/assets/{store-B7Q2yFWb.js → store-B0SHnRWQ.js} +1 -1
- package/dist/ui/assets/{store-B9vKhxq-.js → store-VxOSzjl-.js} +1 -1
- package/dist/ui/assets/{sudo-C7vQszbT.js → sudo-Czy3RSHp.js} +1 -1
- package/dist/ui/assets/{supervisor-B8XLC5F4.js → supervisor-C1U_mbJk.js} +1 -1
- package/dist/ui/assets/{sync-dialog-DYkdAR7f.js → sync-dialog-BSevhYzr.js} +1 -1
- package/dist/ui/assets/{transformers-env-BoqfFDpp.js → transformers-env-BFqDSoRm.js} +1 -1
- package/dist/ui/assets/{tray-leader-Be9y1qqN.js → tray-leader-B-TTtVxr.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-Dc4M6lXI.js → tray-leave-runtime-F82gL38n.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-DQvMF1Ao.js → tray-sidecar-CSE8duGu.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-DyxZBRHK.js → upgrade-detection-6m4gIlJU.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-ByW1Kcmd.js → upskill-lick-skip-egOH0WAN.js} +1 -1
- package/dist/ui/assets/{voice-reply-7yEUC8s_.js → voice-reply-7L1M2iaH.js} +1 -1
- package/dist/ui/assets/{wc-attach-Cht5GxYL.js → wc-attach-D0ieMKnD.js} +2 -2
- package/dist/ui/assets/{wc-browser-CNPt07ut.js → wc-browser-xX--QN5d.js} +1 -1
- package/dist/ui/assets/{wc-computers-mfAtMwPf.js → wc-computers-B-3peUu_.js} +1 -1
- package/dist/ui/assets/{wc-detached-B9yxZ-n5.js → wc-detached-DiOQMAP1.js} +1 -1
- package/dist/ui/assets/{wc-extension-CEYQ0jRT.js → wc-extension-CqrOADhJ.js} +2 -2
- package/dist/ui/assets/{wc-follower-Dig1L7XU.js → wc-follower-OySf7H-Z.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-CoNuNT7_.js → wc-follower-oauth-Bvwr5xD5.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-DV7qZCcd.js → wc-gelatiere-BtkzJ6B6.js} +1 -1
- package/dist/ui/assets/{wc-live-DqGa1g7s.js → wc-live-BNjuHyVT.js} +5 -5
- package/dist/ui/assets/{wc-nav-MxkWV7Eh.js → wc-nav-DdyUqpWN.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-B8k9BOPK.js → wc-onboarding-BGqe9GE8.js} +2 -2
- package/dist/ui/assets/{wc-permissions-D0gWVZDW.js → wc-permissions-CCRPlJmd.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CZPgqag0.js → wc-placeholder-BLqahv-e.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-Czx6L_Ak.js → wc-secret-request-cJs_I_qe.js} +1 -1
- package/dist/ui/assets/{wc-settings-DDLOvAjU.js → wc-settings-msfgRrQg.js} +3 -3
- package/dist/ui/assets/{wc-shell-BXVz8icy.js → wc-shell-xc_aS8JK.js} +3 -3
- package/dist/ui/assets/{wc-shortcut-config-CafKSWSR.js → wc-shortcut-config-DosKyJ_C.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-DCQquR-P.js → wc-sprinkles-B73cr2_W.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-Cws1KmDm.js → wc-transcript-export-S8A8hGAV.js} +2 -2
- package/dist/ui/assets/{wc-tray-BYuoSJJ1.js → wc-tray-CHw6itz7.js} +4 -4
- package/dist/ui/assets/welcome-detection-Hinvtzzk.js +1 -0
- package/dist/ui/assets/{whisper-session-wPvWHvD6.js → whisper-session-ve7TJxVk.js} +2 -2
- package/dist/ui/assets/{xai-grok-BfoEWDbt.js → xai-grok-5HY89T3R.js} +1 -1
- package/dist/ui/assets/{xai-grok-nd89A_Xv.js → xai-grok-CeijOz0o.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/ui/packages/webapp/index.html +3 -3
- package/package.json +1 -1
- package/dist/ui/assets/provider-store-access-B8DU_2PF.js +0 -1
- package/dist/ui/assets/provider-store-access-DcvCWnpM.js +0 -1
- package/dist/ui/assets/slicc-version-DiHRD5WU.js +0 -1
- package/dist/ui/assets/welcome-detection-CdpDLz5b.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import{r as t,t as n}from"./base64-BPBW1Gzr.js";import{n as r}from"./bridge-protocol-31SWTdS5.js";import{a as i,n as a,o,s,t as c}from"./handoff-link-B3It6xQY.js";import{d as l,f as u,i as d,u as f}from"./account-store-EoBfJmnP.js";import{n as p,o as m,r as h,s as g,u as _}from"./proxied-fetch-DXaTHROw.js";import{t as v}from"./runtime-env-DadgceZk.js";import{t as ee}from"./slugify-BYJ6QVAt.js";import{n as te,t as ne}from"./host-command-guuPK7VN.js";import{a as re,i as ie,n as ae,r as oe,t as se}from"./snapshot-DGKjtXNh.js";import{i as ce,r as y}from"./panel-rpc-DW7W4w6_.js";import{a as le,c as ue,n as de,o as fe,s as pe,t as me}from"./feature-flags-QlgHaQc1.js";import{t as he}from"./providers-Cu9hF00M.js";import{r as ge}from"./binary-cache-bSOhqXB1.js";import{i as _e,n as ve,r as ye}from"./fetch-body-CuwTaJC_.js";import{s as be,t as xe}from"./api-endpoint-D8lUKmPu.js";import{t as Se}from"./compat-uEPf6-XW.js";import{a as Ce,i as we}from"./core-5TgOcN68.js";import{n as Te,t as Ee}from"./mime-types-D7IV6i7k.js";import{t as De}from"./secrets-bridge-client-BiJrSKN9.js";import{a as Oe,i as ke,n as Ae,r as je}from"./tool-ui-DRnUkp2g.js";import{a as Me,i as Ne,n as b,t as x}from"./path-utils-DNJG-zQf.js";import{n as Pe,r as Fe,t as Ie}from"./merge-file-core-VJlzucJY.js";import{r as Le}from"./workspace-mode-D0kUKBVS.js";import{n as Re,t as ze}from"./thinking-level-5x0UAu9N.js";import{n as Be,t as Ve}from"./types-D8gIX-W-.js";import{i as He}from"./mount-index-CQfmUPuZ.js";import{a as Ue,i as We,n as Ge,o as Ke,s as qe,t as Je}from"./signed-fetch-By29jUjE.js";import{o as Ye}from"./mount-table-store-DrF_Ifaz.js";import{t as Xe}from"./remote-cache-UwMD8EkX.js";import{n as Ze}from"./fs-COFN8LYS.js";import{a as Qe}from"./tray-leader-status-CpkFr6n7.js";import{n as $e,t as et}from"./slicc-version-DiHRD5WU.js";import{a as tt,i as nt,o as rt,r as S,t as it}from"./browser-CezNe0PF.js";import{t as C}from"./subcommand-flags-BZi7j78Q.js";import{n as at,r as ot,t as w}from"./subcommand-help-CgO7wRS5.js";import{n as st}from"./cost-command-DQXYQYV3.js";import{d as ct,g as lt,i as ut,n as dt,o as ft}from"./sudoers-BdBYQPUn.js";import{n as pt,r as mt,t as ht}from"./approval-timeout-BQ29Z0gf.js";import{a as gt,c as _t,i as vt,l as yt,n as bt,o as xt,r as St,t as Ct}from"./types-BfwydWt7.js";import{n as T,t as wt}from"./boundary-Cp9c_bPu.js";import"./rest-paths-Dia19u9P.js";import{t as Tt}from"./html-B_Hg2WOy.js";import{n as Et}from"./llm-session-id-BZyXP_j2.js";import{t as Dt}from"./src-CUSndb9K.js";import{i as Ot,o as kt}from"./browser-DuyhpHbR.js";import{i as At,r as jt,t as Mt}from"./mount-picker-popup-BMils9JY.js";import{t as Nt}from"./buffer-B5d1xHaH.js";import"./buffer-polyfill-BwLbCySD.js";import{A as Pt,B as E,C as Ft,D,E as It,F as Lt,G as Rt,H as O,I as k,J as zt,K as Bt,L as Vt,M as Ht,N as Ut,O as Wt,P as Gt,R as Kt,S as qt,T as Jt,U as Yt,V as Xt,W as Zt,Y as Qt,_ as $t,a as en,b as tn,c as nn,d as rn,f as an,g as on,h as sn,i as cn,j as ln,k as un,l as dn,m as fn,n as pn,o as mn,p as A,q as hn,r as gn,s as _n,t as vn,u as yn,v as bn,w as xn,x as Sn,y as Cn,z as wn}from"./isomorphic-git-r9mnHMnp.js";import"./global-db-DJXlpNui.js";import{S as Tn,_ as En,a as Dn,b as On,c as kn,d as An,f as jn,g as Mn,h as Nn,i as Pn,l as Fn,n as In,o as Ln,p as Rn,r as zn,s as Bn,t as Vn,u as Hn,v as j,x as M,y as Un}from"./state--dO2CNjQ.js";import{a as Wn,i as Gn,r as Kn,t as qn}from"./git-config-Bdgu8kD2.js";import{a as Jn,n as Yn,o as Xn,r as Zn,s as Qn}from"./jsh-discovery-CnvNKojr.js";import{A as $n,C as er,a as tr,b as nr,c as rr,d as ir,f as ar,h as or,i as sr,j as cr,l as lr,m as ur,n as dr,o as fr,p as pr,r as mr,s as hr,t as N,u as gr,v as _r,y as vr}from"./shared-2XhBobrM.js";import{_ as yr,a as br,b as xr,d as Sr,f as Cr,g as wr,h as Tr,i as Er,l as Dr,m as Or,p as kr,r as Ar,s as jr,u as Mr,v as Nr,x as Pr,y as Fr}from"./require-guards-idkispmW.js";import{_ as Ir,a as Lr,b as Rr,c as zr,d as Br,f as Vr,g as Hr,h as Ur,l as Wr,m as Gr,n as Kr,p as qr,s as Jr,t as Yr,u as Xr,v as Zr,x as Qr,y as $r}from"./jsh-executor-Bv_veUM_.js";import{n as ei,t as ti}from"./esbuild-wasm-CbTVjIj0.js";import{n as ni}from"./wasm-compiler-Ct7QZURL.js";import{a as ri,o as ii,s as ai,t as oi}from"./usb-device-registry-DFzxaOky.js";import{a as P,i as si,r as ci,t as li}from"./just-bash-compat-B-SPHuh_.js";import{i as ui,r as di,t as fi}from"./script-catalog-DZtOMxvi.js";import{a as pi,c as mi,o as hi,s as gi,t as _i}from"./types-Dzr0qYl3.js";import{a as vi,c as yi,d as bi,f as xi,n as Si,r as Ci,u as wi}from"./github-zip-CdhraPsW.js";import{i as Ti,t as Ei}from"./github-auth-BGeZvDDK.js";import{a as Di,i as Oi,o as ki,r as Ai,t as ji}from"./provenance-DdmsQ3Nr.js";import{a as Mi,c as Ni,i as Pi,n as Fi,o as Ii,r as Li,s as Ri}from"./github-install-BuHsKLmH.js";import{n as zi,t as Bi}from"./magick-wasm-BATj-KUu.js";import{i as Vi,n as Hi,r as Ui,t as Wi}from"./pdf-raster-BWk6ezTX.js";import{n as Gi}from"./lick-target-env-8JxfVcIV.js";import{t as Ki}from"./tmpdir-env-ate4iNcK.js";import{n as qi,t as Ji}from"./hf-defaults-BwJdGLgk.js";import{a as Yi,i as Xi,n as Zi,o as Qi,r as $i,t as ea}from"./installer-CRB9PB6D.js";import{i as ta,n as na,r as ra,t as ia}from"./tar-BWIPCxI2.js";import{t as aa}from"./ffmpeg-wasm-CmLVzRDe.js";import{t as oa}from"./local-llm-CbMyPbKh.js";import{t as sa}from"./client-CwxmlQM-.js";import{t as ca}from"./redirect-uri-CBCnYKsl.js";import{a as la,c as ua,i as da,o as fa,r as pa,s as ma}from"./v86-vm-DCm7zA2r.js";import{n as ha,r as ga}from"./lick-urls-CgPiVwD-.js";let _a=null;function va(e){_a=e!==null&&Number.isFinite(e)&&e>0?e:null}function ya(){if(_a!==null)return _a;let e=globalThis.performance?.timeOrigin;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Date.now()}new URL(r).hostname;const ba=/^([0-9a-f]{32})--(?:[0-9a-f]{8}-)?([0-9a-f]+)$/i;function xa(e){let t;try{t=new URL(e.includes(`://`)?e:`https://${e}`).hostname}catch{return null}let n=ba.exec(t.split(`.`)[0]??``);if(!n||!t.includes(`.`))return null;let r=n[1].toLowerCase();return`${[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20)].join(`-`)}.${n[2].toLowerCase()}`}[`ghp_`,`gho_`,`ghu_`,`ghs_`,`ghr_`,`github_pat_`,`sk-`,`pk-`,`xoxb-`,`xoxp-`,`xoxa-`,`xoxs-`,`AKIA`,`ABIA`,`ACCA`,`ASIA`,`sk-ant-`,`Bearer `].sort((e,t)=>t.length-e.length);function Sa(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n===`*`)return!0;if(!n.startsWith(`*.`))return n===r;let i=n.slice(1);return r.length>i.length&&r.endsWith(i)}function Ca(e,t){return e.some(e=>Sa(e,t))}const wa=`slicc-transcript`,Ta=[`canonical-agent-history-unavailable`,`tool-data-may-be-truncated`,`model-metadata-unavailable`,`scoop-history-unavailable`,`attachment-file-missing`,`attachment-association-unavailable`,`complete-snapshot-unavailable`],Ea=new Set(`/export/format./export/producer/application./session/id./session/state./session/completeness/status./session/completeness/missing/*./conversations/*/id./conversations/*/kind./conversations/*/parentConversationId./conversations/*/messages/*/id./conversations/*/messages/*/role./conversations/*/messages/*/timestamp./conversations/*/messages/*/toolCallId./conversations/*/messages/*/content/*/type./conversations/*/messages/*/content/*/id./conversations/*/messages/*/content/*/name./conversations/*/messages/*/content/*/attachmentId./delegations/*/sourceConversationId./delegations/*/targetConversationId./delegations/*/toolCallId./attachments/*/id./attachments/*/path./attachments/*/sha256./attachments/*/sourceConversationId./attachments/*/sourceMessageId./attachments/*/handling./attachments/*/missingReason`.split(`.`));function Da(e){return Ea.has(e.replace(/\/\d+(?=\/|$)/g,`/*`))}var Oa=class extends Error{code;detail;constructor(e,t){super(t?`${e}: ${t}`:e),this.code=e,this.detail=t,this.name=`TranscriptExportError`}};const ka=new Set(Ta),Aa=/^[0-9a-fA-F]{64}$/,ja=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function F(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ma(e){return typeof e==`string`&&Aa.test(e)}function Na(e){return ja.test(e)&&Number.isFinite(Date.parse(e))}function Pa(e,t){let n=t.map(e=>`"${e}"`),r=n[n.length-1];return n.length===2?`${e} must be ${n[0]} or ${r}`:`${e} must be ${n.slice(0,-1).join(`, `)}, or ${r}`}function Fa(e,t,n){return typeof e!=`string`||!t.includes(e)?{ok:!1,error:Pa(n,t)}:{ok:!0}}function Ia(e,t,n){for(let r=0;r<e.length;r++){let i=t(e[r],`${n}[${r}]`);if(!i.ok)return i}return{ok:!0}}function La(e,t){let n=e.type;if(n===`text`){if(typeof e.text!=`string`)return{ok:!1,error:`${t}.text must be a string`}}else if(n===`tool-call`){if(typeof e.id!=`string`||e.id===``)return{ok:!1,error:`${t}.id must be a non-empty string`};if(typeof e.name!=`string`||e.name===``)return{ok:!1,error:`${t}.name must be a non-empty string`};if(!(`input`in e))return{ok:!1,error:`${t}.input must be present`}}else if(typeof e.attachmentId!=`string`||e.attachmentId===``)return{ok:!1,error:`${t}.attachmentId must be a non-empty string`};return{ok:!0}}function Ra(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Fa(e.type,[`text`,`tool-call`,`attachment-ref`],`${t}.type`);return n.ok?La(e,t):n}function za(e,t){for(let n of[`input`,`output`,`cacheRead`,`cacheWrite`,`totalTokens`]){let r=e[n];if(typeof r!=`number`)return{ok:!1,error:`${t}.${n} must be a number`};if(!Number.isInteger(r)||r<0)return{ok:!1,error:`${t}.${n} must be a non-negative integer`}}return{ok:!0}}function Ba(e,t){for(let n of[`input`,`output`,`cacheRead`,`cacheWrite`,`total`]){let r=e[n];if(typeof r!=`number`)return{ok:!1,error:`${t}.${n} must be a number`};if(!Number.isFinite(r)||r<0)return{ok:!1,error:`${t}.${n} must be a finite non-negative number`}}return{ok:!0}}function Va(e,t){let n=za(e,t);if(!n.ok)return n;let r=e.cost;return F(r)?Ba(r,`${t}.cost`):{ok:!1,error:`${t}.cost must be a non-null object`}}function Ha(e,t){if(typeof e.id!=`string`)return{ok:!1,error:`${t}.id must be a string`};if(typeof e.sequence!=`number`)return{ok:!1,error:`${t}.sequence must be a number`};let n=e.sequence;return!Number.isInteger(n)||n<1?{ok:!1,error:`${t}.sequence must be a positive integer`}:typeof e.timestamp==`string`?Na(e.timestamp)?{ok:!0}:{ok:!1,error:`${t}.timestamp must be a valid ISO 8601 date-time string`}:{ok:!1,error:`${t}.timestamp must be a string`}}function Ua(e,t){let n=e.toolCallId;return typeof n!=`string`||n===``?{ok:!1,error:`${t}.toolCallId must be a non-empty string for tool-result messages`}:{ok:!0}}function Wa(e,t){let n=e.usage;return n===void 0?{ok:!0}:F(n)?Va(n,`${t}.usage`):{ok:!1,error:`${t}.usage must be a non-null object`}}function Ga(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Fa(e.role,[`user`,`assistant`,`tool-result`],`${t}.role`);if(!n.ok)return n;if(e.role===`tool-result`){let n=Ua(e,t);if(!n.ok)return n}let r=Ha(e,t);if(!r.ok)return r;let i=e.content;if(!Array.isArray(i))return{ok:!1,error:`${t}.content must be an array`};let a=Ia(i,Ra,`${t}.content`);return a.ok?Wa(e,t):a}function Ka(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`${t}.id must be a string`};if(typeof e.name!=`string`)return{ok:!1,error:`${t}.name must be a string`};let n=Fa(e.kind,[`cone`,`scoop`],`${t}.kind`);if(!n.ok)return n;let r=e.messages;return Array.isArray(r)?Ia(r,Ga,`${t}.messages`):{ok:!1,error:`${t}.messages must be an array`}}function qa(e,t){for(let n of[`id`,`path`,`originalName`,`mimeType`,`sha256`,`sourceConversationId`,`sourceMessageId`])if(typeof e[n]!=`string`)return{ok:!1,error:`${t}.${n} must be a string`};return{ok:!0}}function Ja(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?{ok:!1,error:`${t}.path must be non-empty when present`}:Ma(r)?!Number.isInteger(i)||i<0?{ok:!1,error:`${t}.byteLength must be a non-negative integer when present`}:e.missingReason===void 0?{ok:!0}:{ok:!1,error:`${t}.missingReason must be absent when present is true`}:{ok:!1,error:`${t}.sha256 must be a 64-char hex string when present`}}const Ya=[`attachment-file-missing`,`attachment-association-unavailable`];function Xa(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?r===``?i===0?Fa(e.missingReason,Ya,`${t}.missingReason`):{ok:!1,error:`${t}.byteLength must be zero when not present`}:{ok:!1,error:`${t}.sha256 must be empty when not present`}:{ok:!1,error:`${t}.path must be empty when not present`}}function Za(e,t){return e.present?Ja(e,t):Xa(e,t)}function Qa(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};let n=qa(e,t);if(!n.ok)return n;if(typeof e.byteLength!=`number`)return{ok:!1,error:`${t}.byteLength must be a number`};if(typeof e.present!=`boolean`)return{ok:!1,error:`${t}.present must be a boolean`};let r=Fa(e.handling,[`text-redacted`,`binary-unchanged`],`${t}.handling`);return r.ok?Za(e,t):r}function $a(e,t){let n=Fa(e.kind,[`json`,`attachment`],`${t}.kind`);if(!n.ok)return n;if(e.kind===`json`){if(typeof e.pointer!=`string`)return{ok:!1,error:`${t}.pointer must be a string`};let n=e.pointer;if(n!==``&&!n.startsWith(`/`))return{ok:!1,error:`${t}.pointer must be a valid RFC 6901 JSON pointer`}}else if(typeof e.attachmentId!=`string`||e.attachmentId===``)return{ok:!1,error:`${t}.attachmentId must be a non-empty string`};return{ok:!0}}function eo(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`${t}.id must be a string`};if(typeof e.category!=`string`)return{ok:!1,error:`${t}.category must be a string`};let n=Fa(e.detector,[`known-secret`,`credential-pattern`,`pre-obfuscated`],`${t}.detector`);if(!n.ok)return n;let r=e.target;return F(r)?$a(r,`${t}.target`):{ok:!1,error:`${t}.target must be a non-null object`}}function to(e,t){return F(e)?typeof e.sourceConversationId==`string`?typeof e.targetConversationId==`string`?{ok:!0}:{ok:!1,error:`${t}.targetConversationId must be a string`}:{ok:!1,error:`${t}.sourceConversationId must be a string`}:{ok:!1,error:`${t} must be a non-null object`}}function no(e,t){return typeof e!=`string`||!ka.has(e)?{ok:!1,error:`${t} is not a valid completeness reason`}:{ok:!0}}function ro(e){if(!F(e))return{ok:!1,error:`export must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`export.id must be a string`};if(typeof e.generatedAt!=`string`)return{ok:!1,error:`export.generatedAt must be a string`};if(e.format!==`slicc-transcript`)return{ok:!1,error:`export.format must equal "slicc-transcript"`};let t=e.producer;return F(t)?t.application===`slicc`?typeof t.version==`string`?{ok:!0}:{ok:!1,error:`export.producer.version must be a string`}:{ok:!1,error:`export.producer.application must equal "slicc"`}:{ok:!1,error:`export.producer must be a non-null object`}}function io(e){if(!F(e))return{ok:!1,error:`session.completeness must be a non-null object`};let t=Fa(e.status,[`complete`,`partial`],`session.completeness.status`);return t.ok?Array.isArray(e.missing)?Ia(e.missing,no,`session.completeness.missing`):{ok:!1,error:`session.completeness.missing must be an array`}:t}function ao(e){if(!F(e))return{ok:!1,error:`session must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`session.id must be a string`};if(typeof e.title!=`string`)return{ok:!1,error:`session.title must be a string`};let t=Fa(e.state,[`active`,`frozen`],`session.state`);return t.ok?io(e.completeness):t}function oo(e){if(!F(e))return{ok:!1,error:`privacy must be a non-null object`};if(e.reasoningExcluded!==!0)return{ok:!1,error:`privacy.reasoningExcluded must be true`};let t=e.excludedReasoningBlocks;if(typeof t!=`number`)return{ok:!1,error:`privacy.excludedReasoningBlocks must be a number`};if(!Number.isInteger(t)||t<0)return{ok:!1,error:`privacy.excludedReasoningBlocks must be a non-negative integer`};if(e.binaryAttachments!==`included-unchanged`)return{ok:!1,error:`privacy.binaryAttachments must equal "included-unchanged"`};if(!F(e.redactionCounts))return{ok:!1,error:`privacy.redactionCounts must be a non-null object`};let n=e.redactions;return Array.isArray(n)?Ia(n,eo,`privacy.redactions`):{ok:!1,error:`privacy.redactions must be an array`}}function so(e){let t=e.conversations;if(!Array.isArray(t))return{ok:!1,error:`conversations must be an array`};let n=Ia(t,Ka,`conversations`);if(!n.ok)return n;let r=e.delegations;if(!Array.isArray(r))return{ok:!1,error:`delegations must be an array`};let i=Ia(r,to,`delegations`);if(!i.ok)return i;let a=e.attachments;return Array.isArray(a)?Ia(a,Qa,`attachments`):{ok:!1,error:`attachments must be an array`}}function co(e){let t=new Set,n=new Set;for(let r of e){if(!F(r)||typeof r.id!=`string`)continue;if(t.has(r.id))return{ok:!1,error:`duplicate conversation id "${r.id}"`};t.add(r.id);let e=r.messages;if(Array.isArray(e)){for(let t of e)if(!(!F(t)||typeof t.id!=`string`)){if(n.has(t.id))return{ok:!1,error:`duplicate message id "${t.id}"`};n.add(t.id)}}}return{ok:!0}}function lo(e){for(let t of e){if(!F(t))continue;let e=t.messages;if(!Array.isArray(e))continue;let n=typeof t.id==`string`?t.id:`?`,r=0;for(let t of e){if(!F(t)||typeof t.sequence!=`number`)continue;let e=t.sequence;if(e<=r)return{ok:!1,error:`sequences in conversation "${n}" must be strictly increasing`};r=e}}return{ok:!0}}function uo(e){let t=[];for(let n of e){if(!F(n))continue;let e=n.content;if(Array.isArray(e))for(let n of e)F(n)&&n.type===`tool-call`&&typeof n.id==`string`&&t.push(n.id)}return t}function fo(e){let t=new Set;for(let n of e){if(!F(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of uo(e))t.add(n)}return t}function po(e,t){for(let n of e){if(!F(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!F(n)||n.role!==`tool-result`)continue;let e=n.toolCallId;if(typeof e==`string`&&e!==``&&!t.has(e))return{ok:!1,error:`tool-result message references unknown toolCallId "${e}"`}}}return{ok:!0}}function mo(e){return po(e,fo(e))}function ho(e,t){for(let n of e){if(!F(n)||n.type!==`attachment-ref`)continue;let e=n.attachmentId;if(typeof e!=`string`||!t.has(e))return{ok:!1,error:`attachment-ref references unknown attachmentId "${e}"`}}return{ok:!0}}function go(e,t){for(let n of e){if(!F(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!F(n))continue;let e=n.content;if(!Array.isArray(e))continue;let r=ho(e,t);if(!r.ok)return r}}return{ok:!0}}function _o(e,t){let n=new Set;for(let e of t)F(e)&&typeof e.id==`string`&&n.add(e.id);return go(e,n)}function vo(e){let t=new Map;for(let n of e){if(!F(n)||typeof n.id!=`string`)continue;let e=new Set,r=n.messages;if(Array.isArray(r))for(let t of r)F(t)&&typeof t.id==`string`&&e.add(t.id);t.set(n.id,e)}return t}function yo(e,t){let n=vo(t);for(let t=0;t<e.length;t++){let r=e[t];if(!F(r))continue;let i=r.sourceConversationId,a=r.sourceMessageId;if(typeof i!=`string`||typeof a!=`string`)continue;let o=n.get(i);if(!o)return{ok:!1,error:`attachments[${t}].sourceConversationId "${i}" does not exist`};if(!o.has(a))return{ok:!1,error:`attachments[${t}].sourceMessageId "${a}" does not exist in conversation "${i}"`}}return{ok:!0}}function bo(e){let t=new Map;for(let n of e){if(!F(n)||typeof n.id!=`string`)continue;let e=Array.isArray(n.messages)?n.messages:[];t.set(n.id,new Set(uo(e)))}return t}function xo(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!F(i))continue;let a=i.sourceConversationId,o=i.targetConversationId;if(typeof a!=`string`||!t.has(a))return{ok:!1,error:`delegations[${r}].sourceConversationId "${a}" does not exist`};if(typeof o!=`string`||!t.has(o))return{ok:!1,error:`delegations[${r}].targetConversationId "${o}" does not exist`};let s=i.toolCallId;if(typeof s==`string`&&s!==``&&!n.get(a)?.has(s))return{ok:!1,error:`delegations[${r}].toolCallId "${s}" does not exist in source conversation "${a}"`}}return{ok:!0}}function So(e,t){let n=new Set;for(let e of t)F(e)&&typeof e.id==`string`&&n.add(e.id);return xo(e,n,bo(t))}function Co(e,t,n){if(e.kind!==`attachment`)return{ok:!0};let r=e.attachmentId;return typeof r!=`string`||!t.has(r)?{ok:!1,error:`${n}.attachmentId "${r}" does not reference a known attachment`}:{ok:!0}}function wo(e,t){let n=new Set;for(let e of t)F(e)&&typeof e.id==`string`&&n.add(e.id);for(let t=0;t<e.length;t++){let r=e[t];if(!F(r))continue;let i=r.target;if(!F(i))continue;let a=Co(i,n,`privacy.redactions[${t}].target`);if(!a.ok)return a}return{ok:!0}}function To(e){let t=e.conversations,n=e.attachments,r=e.delegations,i=e.privacy,a=Array.isArray(i?.redactions)?i.redactions:[],o=co(t);if(!o.ok)return o;let s=lo(t);if(!s.ok)return s;let c=mo(t);if(!c.ok)return c;let l=_o(t,n);if(!l.ok)return l;let u=yo(n,t);if(!u.ok)return u;let d=So(r,t);return d.ok?wo(a,n):d}function Eo(e){let t=so(e);return t.ok?To(e):t}function Do(e){if(!F(e))return{ok:!1,error:`document must be a non-null object`};if(e.schemaVersion!==1)return{ok:!1,error:`schemaVersion must equal 1`};let t=ro(e.export);if(!t.ok)return t;let n=ao(e.session);if(!n.ok)return n;let r=oo(e.privacy);return r.ok?Eo(e):r}async function Oo(e,t,n){let r=await n({method:`GET`,path:`/${e}/sites/${t}/config.json`,origin:Ke});if(r.status===401||r.status===403)throw Error(`not authorized to read the site config for ${e}/${t} — log in via Settings → Providers → Adobe, or pass --backend to skip the probe`);if(r.status===404)throw Error(`no site config for ${e}/${t} — check the org and site names`);if(r.status>=400)throw Error(`site config probe failed for ${e}/${t}: ${r.status}`);let i;try{i=await r.json()}catch(n){throw Error(`site config for ${e}/${t} is not JSON: ${n instanceof Error?n.message:String(n)}`)}let a=i.content?.source?.url;return{backend:ko(a),sourceUrl:a}}function ko(e){if(!e)return`da`;let t;try{t=new URL(e).host}catch{return`da`}return t===`api.aem.live`?`aem`:`da`}const Ao=`slicc-sprinkle-routes`;function jo(){try{let e=localStorage.getItem(Ao);return e?JSON.parse(e):{}}catch{return{}}}function Mo(e){try{localStorage.setItem(Ao,JSON.stringify(e))}catch{}}function No(e){return jo()[e]}function Po(e,t){let n=jo();n[e]=t,Mo(n)}function Fo(e){let t=jo();delete t[e],Mo(t)}function Io(){return jo()}function Lo(e,t,n){return _t(t,n,`${e} adapter does not implement ${t}.${n}`)}function Ro(e,t,n,r){let i=n.filter(e=>typeof r?.[e]==`function`),a=n.map(n=>{let i=r?.[n];return[n,typeof i==`function`?i:()=>Promise.resolve(Lo(e,t,n))]});return{...Object.fromEntries(a),allowlist:i,supports:e=>i.includes(e)}}function zo(e){let{adapter:t,pageGestures:n}=e,r=n??{};return{adapter:t,browser:Ro(t,`browser`,bt,e.browser),network:Ro(t,`network`,gt,e.network),secrets:Ro(t,`secrets`,xt,e.secrets),devices:Ro(t,`devices`,St,{usbRequest:r.usbRequest,serialRequest:r.serialRequest,hidRequest:r.hidRequest,...e.devices}),mounts:Ro(t,`mounts`,vt,{pickDirectory:r.pickDirectory,...e.mounts}),approvals:Ro(t,`approvals`,Ct,e.approvals)}}function Bo(e={}){return zo({adapter:`connect`,pageGestures:e.pageGestures})}function Vo(e){let t=wt(()=>import(`./extension-ops-CF2mLDRW.js`).then(t=>t.createExtensionOps(e)));return zo({adapter:e.adapter,pageGestures:e.pageGestures,network:{crossOriginFetch:e=>T(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>T(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>T(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>T(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>T(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>T(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>T(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function Ho(e={}){let t=wt(()=>import(`./rest-ops-CLliBy-9.js`).then(t=>t.createRestOps(e)),e.controlTimeoutMs??1e4);return zo({adapter:`node-rest`,pageGestures:e.pageGestures,network:{localNodeServer:()=>Promise.resolve({ok:!0,value:{available:!0}}),crossOriginFetch:e=>T(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>T(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>T(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>T(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>T(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>T(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>T(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function Uo(e,t={}){let{pageGestures:n}=t;switch(e){case`node-rest`:return Ho({pageGestures:n});case`extension-direct`:case`extension-delegate`:return Vo({adapter:e,pageGestures:n});case`connect`:return Bo({pageGestures:n})}}const Wo=e(`quick-llm`);async function Go(e){let t=d();if(!t)return Wo.debug(`No API key for active provider — skipping`),null;let n=u(),r=l(),i;if(i=e.modelId?Yo(n,e.modelId)??Yo(n,r):Ko(n,r),!i)return Wo.debug(`No model available for provider`,{providerId:n}),null;let a={role:`user`,content:e.prompt,timestamp:Date.now()},o={};i.provider===`adobe`&&(o[`X-Session-Id`]=Xo());try{let n=(await Se(i,{systemPrompt:e.system,messages:[a]},{apiKey:t,maxTokens:e.maxTokens??60,temperature:e.temperature??.3,signal:e.signal,headers:Object.keys(o).length>0?o:void 0})).content.filter(e=>e.type===`text`).map(e=>e.text).join(``).trim();return n.length>0?n:null}catch(e){return Wo.debug(`Quick label call failed`,{error:e instanceof Error?e.message:String(e)}),null}}function Ko(e,t){let n=f(e);if(n.length===0)return;let r=n.find(e=>e.id===t)??n[0],i=Jo(r.id),a=n.filter(e=>qo(e,r,i));return a.length===0?r:(a.sort((e,t)=>(e.cost?.input??0)-(t.cost?.input??0)),a[0])}function qo(e,t,n){if(e.id===t.id)return!1;let r=t.cost?.input??1/0;if((e.cost?.input??1/0)>=r)return!1;let i=e.id.toLowerCase();switch(n){case`claude`:return i.includes(`haiku`);case`gpt`:return/(^|-)mini(-|$)|(^|-)nano(-|$)/.test(i);case`gemini`:return i.includes(`flash`);case`grok`:return/(^|-)mini(-|$)|(^|-)fast(-|$)/.test(i);case`unknown`:return!0}}function Jo(e){let t=e.toLowerCase();return t.includes(`claude`)?`claude`:t.includes(`gemini`)?`gemini`:t.includes(`grok`)?`grok`:/^(gpt|o\d)/.test(t)?`gpt`:`unknown`}function Yo(e,t){return f(e).find(e=>e.id===t)}function Xo(){return Et(`ui-quick-llm`)}const Zo=e(`sudo-suggest`),Qo=[`You generalize a single shell command into a minimal glob pattern for an`,`allow-list rule. Output ONLY the pattern on one line — no prose, no quotes,`,`no backticks. Keep the leading command/sub-command verbatim and replace only`,`the volatile tail (args, paths, refs) with a single trailing "*".`,`Examples:`,` git push origin main -> git push*`,` rm -rf build/cache -> rm -rf*`,` npm install left-pad -> npm install*`].join(`
|
|
1
|
+
import{t as e}from"./logger-LESFN7Hj.js";import{r as t,t as n}from"./base64-BPBW1Gzr.js";import{n as r}from"./bridge-protocol-31SWTdS5.js";import{a as i,n as a,o,s,t as c}from"./handoff-link-B3It6xQY.js";import{d as l,f as u,i as d,u as f}from"./account-store-BQYiWjX3.js";import{n as p,o as m,r as h,s as g,u as _}from"./proxied-fetch-DXaTHROw.js";import{t as v}from"./runtime-env-DadgceZk.js";import{t as ee}from"./slugify-BYJ6QVAt.js";import{n as te,t as ne}from"./host-command-guuPK7VN.js";import{a as re,i as ie,n as ae,r as oe,t as se}from"./snapshot-B8xhdpDw.js";import{i as ce,r as y}from"./panel-rpc-DW7W4w6_.js";import{a as le,c as ue,n as de,o as fe,s as pe,t as me}from"./feature-flags-QlgHaQc1.js";import{t as he}from"./providers-BHHpCtcj.js";import{r as ge}from"./binary-cache-bSOhqXB1.js";import{i as _e,n as ve,r as ye}from"./fetch-body-CuwTaJC_.js";import{s as be,t as xe}from"./api-endpoint-D8lUKmPu.js";import{t as Se}from"./compat-uEPf6-XW.js";import{a as Ce,i as we}from"./core-5TgOcN68.js";import{n as Te,t as Ee}from"./mime-types-D7IV6i7k.js";import{t as De}from"./secrets-bridge-client-BiJrSKN9.js";import{a as Oe,i as ke,n as Ae,r as je}from"./tool-ui-DRnUkp2g.js";import{a as Me,i as Ne,n as b,t as x}from"./path-utils-DNJG-zQf.js";import{n as Pe,r as Fe,t as Ie}from"./merge-file-core-VJlzucJY.js";import{r as Le}from"./workspace-mode-D0kUKBVS.js";import{n as Re,t as ze}from"./thinking-level-5x0UAu9N.js";import{n as Be,t as Ve}from"./types-D8gIX-W-.js";import{i as He}from"./mount-index-CQfmUPuZ.js";import{a as Ue,i as We,n as Ge,o as Ke,s as qe,t as Je}from"./signed-fetch-DCg1T80I.js";import{o as Ye}from"./mount-table-store-DrF_Ifaz.js";import{t as Xe}from"./remote-cache-UwMD8EkX.js";import{n as Ze}from"./fs-CSXuJafL.js";import{a as Qe}from"./tray-leader-status-CpkFr6n7.js";import{n as $e,t as et}from"./slicc-version-BMxOs5kP.js";import{a as tt,i as nt,o as rt,r as S,t as it}from"./browser-CezNe0PF.js";import{t as C}from"./subcommand-flags-BZi7j78Q.js";import{n as at,r as ot,t as w}from"./subcommand-help-CgO7wRS5.js";import{n as st}from"./cost-command-DQXYQYV3.js";import{d as ct,g as lt,i as ut,n as dt,o as ft}from"./sudoers-BdBYQPUn.js";import{n as pt,r as mt,t as ht}from"./approval-timeout-BQ29Z0gf.js";import{a as gt,c as _t,i as vt,l as yt,n as bt,o as xt,r as St,t as Ct}from"./types-BfwydWt7.js";import{n as T,t as wt}from"./boundary-Cp9c_bPu.js";import"./rest-paths-Dia19u9P.js";import{t as Tt}from"./html-B_Hg2WOy.js";import{n as Et}from"./llm-session-id-BZyXP_j2.js";import{t as Dt}from"./src-CUSndb9K.js";import{i as Ot,o as kt}from"./browser-DuyhpHbR.js";import{i as At,r as jt,t as Mt}from"./mount-picker-popup-BMils9JY.js";import{t as Nt}from"./buffer-B5d1xHaH.js";import"./buffer-polyfill-BwLbCySD.js";import{A as Pt,B as E,C as Ft,D,E as It,F as Lt,G as Rt,H as O,I as k,J as zt,K as Bt,L as Vt,M as Ht,N as Ut,O as Wt,P as Gt,R as Kt,S as qt,T as Jt,U as Yt,V as Xt,W as Zt,Y as Qt,_ as $t,a as en,b as tn,c as nn,d as rn,f as an,g as on,h as sn,i as cn,j as ln,k as un,l as dn,m as fn,n as pn,o as mn,p as A,q as hn,r as gn,s as _n,t as vn,u as yn,v as bn,w as xn,x as Sn,y as Cn,z as wn}from"./isomorphic-git-r9mnHMnp.js";import"./global-db-DJXlpNui.js";import{S as Tn,_ as En,a as Dn,b as On,c as kn,d as An,f as jn,g as Mn,h as Nn,i as Pn,l as Fn,n as In,o as Ln,p as Rn,r as zn,s as Bn,t as Vn,u as Hn,v as j,x as M,y as Un}from"./state-C0-ygS-7.js";import{a as Wn,i as Gn,r as Kn,t as qn}from"./git-config-Bdgu8kD2.js";import{a as Jn,n as Yn,o as Xn,r as Zn,s as Qn}from"./jsh-discovery-CnvNKojr.js";import{A as $n,C as er,a as tr,b as nr,c as rr,d as ir,f as ar,h as or,i as sr,j as cr,l as lr,m as ur,n as dr,o as fr,p as pr,r as mr,s as hr,t as N,u as gr,v as _r,y as vr}from"./shared-2XhBobrM.js";import{_ as yr,a as br,b as xr,d as Sr,f as Cr,g as wr,h as Tr,i as Er,l as Dr,m as Or,p as kr,r as Ar,s as jr,u as Mr,v as Nr,x as Pr,y as Fr}from"./require-guards-idkispmW.js";import{_ as Ir,a as Lr,b as Rr,c as zr,d as Br,f as Vr,g as Hr,h as Ur,l as Wr,m as Gr,n as Kr,p as qr,s as Jr,t as Yr,u as Xr,v as Zr,x as Qr,y as $r}from"./jsh-executor-CPKLmDKX.js";import{n as ei,t as ti}from"./esbuild-wasm-CbTVjIj0.js";import{n as ni}from"./wasm-compiler-Ct7QZURL.js";import{a as ri,o as ii,s as ai,t as oi}from"./usb-device-registry-DFzxaOky.js";import{a as P,i as si,r as ci,t as li}from"./just-bash-compat-B-SPHuh_.js";import{i as ui,r as di,t as fi}from"./script-catalog-DZtOMxvi.js";import{a as pi,c as mi,o as hi,s as gi,t as _i}from"./types-Dzr0qYl3.js";import{a as vi,c as yi,d as bi,f as xi,n as Si,r as Ci,u as wi}from"./github-zip-BJkh1FPE.js";import{i as Ti,t as Ei}from"./github-auth-CzBLV9g_.js";import{a as Di,i as Oi,o as ki,r as Ai,t as ji}from"./provenance-DdmsQ3Nr.js";import{a as Mi,c as Ni,i as Pi,n as Fi,o as Ii,r as Li,s as Ri}from"./github-install-BCFfvAe2.js";import{n as zi,t as Bi}from"./magick-wasm-BATj-KUu.js";import{i as Vi,n as Hi,r as Ui,t as Wi}from"./pdf-raster-BWk6ezTX.js";import{n as Gi}from"./lick-target-env-8JxfVcIV.js";import{t as Ki}from"./tmpdir-env-ate4iNcK.js";import{n as qi,t as Ji}from"./hf-defaults-BwJdGLgk.js";import{a as Yi,i as Xi,n as Zi,o as Qi,r as $i,t as ea}from"./installer-B1DgYJv5.js";import{i as ta,n as na,r as ra,t as ia}from"./tar-BWIPCxI2.js";import{t as aa}from"./ffmpeg-wasm-CmLVzRDe.js";import{t as oa}from"./local-llm-DFZMKK35.js";import{t as sa}from"./client-CwxmlQM-.js";import{t as ca}from"./redirect-uri-CBCnYKsl.js";import{a as la,c as ua,i as da,o as fa,r as pa,s as ma}from"./v86-vm-DCm7zA2r.js";import{n as ha,r as ga}from"./lick-urls-CgPiVwD-.js";let _a=null;function va(e){_a=e!==null&&Number.isFinite(e)&&e>0?e:null}function ya(){if(_a!==null)return _a;let e=globalThis.performance?.timeOrigin;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Date.now()}new URL(r).hostname;const ba=/^([0-9a-f]{32})--(?:[0-9a-f]{8}-)?([0-9a-f]+)$/i;function xa(e){let t;try{t=new URL(e.includes(`://`)?e:`https://${e}`).hostname}catch{return null}let n=ba.exec(t.split(`.`)[0]??``);if(!n||!t.includes(`.`))return null;let r=n[1].toLowerCase();return`${[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20)].join(`-`)}.${n[2].toLowerCase()}`}[`ghp_`,`gho_`,`ghu_`,`ghs_`,`ghr_`,`github_pat_`,`sk-`,`pk-`,`xoxb-`,`xoxp-`,`xoxa-`,`xoxs-`,`AKIA`,`ABIA`,`ACCA`,`ASIA`,`sk-ant-`,`Bearer `].sort((e,t)=>t.length-e.length);function Sa(e,t){let n=e.toLowerCase(),r=t.toLowerCase();if(n===`*`)return!0;if(!n.startsWith(`*.`))return n===r;let i=n.slice(1);return r.length>i.length&&r.endsWith(i)}function Ca(e,t){return e.some(e=>Sa(e,t))}const wa=`slicc-transcript`,Ta=[`canonical-agent-history-unavailable`,`tool-data-may-be-truncated`,`model-metadata-unavailable`,`scoop-history-unavailable`,`attachment-file-missing`,`attachment-association-unavailable`,`complete-snapshot-unavailable`],Ea=new Set(`/export/format./export/producer/application./session/id./session/state./session/completeness/status./session/completeness/missing/*./conversations/*/id./conversations/*/kind./conversations/*/parentConversationId./conversations/*/messages/*/id./conversations/*/messages/*/role./conversations/*/messages/*/timestamp./conversations/*/messages/*/toolCallId./conversations/*/messages/*/content/*/type./conversations/*/messages/*/content/*/id./conversations/*/messages/*/content/*/name./conversations/*/messages/*/content/*/attachmentId./delegations/*/sourceConversationId./delegations/*/targetConversationId./delegations/*/toolCallId./attachments/*/id./attachments/*/path./attachments/*/sha256./attachments/*/sourceConversationId./attachments/*/sourceMessageId./attachments/*/handling./attachments/*/missingReason`.split(`.`));function Da(e){return Ea.has(e.replace(/\/\d+(?=\/|$)/g,`/*`))}var Oa=class extends Error{code;detail;constructor(e,t){super(t?`${e}: ${t}`:e),this.code=e,this.detail=t,this.name=`TranscriptExportError`}};const ka=new Set(Ta),Aa=/^[0-9a-fA-F]{64}$/,ja=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function F(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ma(e){return typeof e==`string`&&Aa.test(e)}function Na(e){return ja.test(e)&&Number.isFinite(Date.parse(e))}function Pa(e,t){let n=t.map(e=>`"${e}"`),r=n[n.length-1];return n.length===2?`${e} must be ${n[0]} or ${r}`:`${e} must be ${n.slice(0,-1).join(`, `)}, or ${r}`}function Fa(e,t,n){return typeof e!=`string`||!t.includes(e)?{ok:!1,error:Pa(n,t)}:{ok:!0}}function Ia(e,t,n){for(let r=0;r<e.length;r++){let i=t(e[r],`${n}[${r}]`);if(!i.ok)return i}return{ok:!0}}function La(e,t){let n=e.type;if(n===`text`){if(typeof e.text!=`string`)return{ok:!1,error:`${t}.text must be a string`}}else if(n===`tool-call`){if(typeof e.id!=`string`||e.id===``)return{ok:!1,error:`${t}.id must be a non-empty string`};if(typeof e.name!=`string`||e.name===``)return{ok:!1,error:`${t}.name must be a non-empty string`};if(!(`input`in e))return{ok:!1,error:`${t}.input must be present`}}else if(typeof e.attachmentId!=`string`||e.attachmentId===``)return{ok:!1,error:`${t}.attachmentId must be a non-empty string`};return{ok:!0}}function Ra(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Fa(e.type,[`text`,`tool-call`,`attachment-ref`],`${t}.type`);return n.ok?La(e,t):n}function za(e,t){for(let n of[`input`,`output`,`cacheRead`,`cacheWrite`,`totalTokens`]){let r=e[n];if(typeof r!=`number`)return{ok:!1,error:`${t}.${n} must be a number`};if(!Number.isInteger(r)||r<0)return{ok:!1,error:`${t}.${n} must be a non-negative integer`}}return{ok:!0}}function Ba(e,t){for(let n of[`input`,`output`,`cacheRead`,`cacheWrite`,`total`]){let r=e[n];if(typeof r!=`number`)return{ok:!1,error:`${t}.${n} must be a number`};if(!Number.isFinite(r)||r<0)return{ok:!1,error:`${t}.${n} must be a finite non-negative number`}}return{ok:!0}}function Va(e,t){let n=za(e,t);if(!n.ok)return n;let r=e.cost;return F(r)?Ba(r,`${t}.cost`):{ok:!1,error:`${t}.cost must be a non-null object`}}function Ha(e,t){if(typeof e.id!=`string`)return{ok:!1,error:`${t}.id must be a string`};if(typeof e.sequence!=`number`)return{ok:!1,error:`${t}.sequence must be a number`};let n=e.sequence;return!Number.isInteger(n)||n<1?{ok:!1,error:`${t}.sequence must be a positive integer`}:typeof e.timestamp==`string`?Na(e.timestamp)?{ok:!0}:{ok:!1,error:`${t}.timestamp must be a valid ISO 8601 date-time string`}:{ok:!1,error:`${t}.timestamp must be a string`}}function Ua(e,t){let n=e.toolCallId;return typeof n!=`string`||n===``?{ok:!1,error:`${t}.toolCallId must be a non-empty string for tool-result messages`}:{ok:!0}}function Wa(e,t){let n=e.usage;return n===void 0?{ok:!0}:F(n)?Va(n,`${t}.usage`):{ok:!1,error:`${t}.usage must be a non-null object`}}function Ga(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Fa(e.role,[`user`,`assistant`,`tool-result`],`${t}.role`);if(!n.ok)return n;if(e.role===`tool-result`){let n=Ua(e,t);if(!n.ok)return n}let r=Ha(e,t);if(!r.ok)return r;let i=e.content;if(!Array.isArray(i))return{ok:!1,error:`${t}.content must be an array`};let a=Ia(i,Ra,`${t}.content`);return a.ok?Wa(e,t):a}function Ka(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`${t}.id must be a string`};if(typeof e.name!=`string`)return{ok:!1,error:`${t}.name must be a string`};let n=Fa(e.kind,[`cone`,`scoop`],`${t}.kind`);if(!n.ok)return n;let r=e.messages;return Array.isArray(r)?Ia(r,Ga,`${t}.messages`):{ok:!1,error:`${t}.messages must be an array`}}function qa(e,t){for(let n of[`id`,`path`,`originalName`,`mimeType`,`sha256`,`sourceConversationId`,`sourceMessageId`])if(typeof e[n]!=`string`)return{ok:!1,error:`${t}.${n} must be a string`};return{ok:!0}}function Ja(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?{ok:!1,error:`${t}.path must be non-empty when present`}:Ma(r)?!Number.isInteger(i)||i<0?{ok:!1,error:`${t}.byteLength must be a non-negative integer when present`}:e.missingReason===void 0?{ok:!0}:{ok:!1,error:`${t}.missingReason must be absent when present is true`}:{ok:!1,error:`${t}.sha256 must be a 64-char hex string when present`}}const Ya=[`attachment-file-missing`,`attachment-association-unavailable`];function Xa(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?r===``?i===0?Fa(e.missingReason,Ya,`${t}.missingReason`):{ok:!1,error:`${t}.byteLength must be zero when not present`}:{ok:!1,error:`${t}.sha256 must be empty when not present`}:{ok:!1,error:`${t}.path must be empty when not present`}}function Za(e,t){return e.present?Ja(e,t):Xa(e,t)}function Qa(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};let n=qa(e,t);if(!n.ok)return n;if(typeof e.byteLength!=`number`)return{ok:!1,error:`${t}.byteLength must be a number`};if(typeof e.present!=`boolean`)return{ok:!1,error:`${t}.present must be a boolean`};let r=Fa(e.handling,[`text-redacted`,`binary-unchanged`],`${t}.handling`);return r.ok?Za(e,t):r}function $a(e,t){let n=Fa(e.kind,[`json`,`attachment`],`${t}.kind`);if(!n.ok)return n;if(e.kind===`json`){if(typeof e.pointer!=`string`)return{ok:!1,error:`${t}.pointer must be a string`};let n=e.pointer;if(n!==``&&!n.startsWith(`/`))return{ok:!1,error:`${t}.pointer must be a valid RFC 6901 JSON pointer`}}else if(typeof e.attachmentId!=`string`||e.attachmentId===``)return{ok:!1,error:`${t}.attachmentId must be a non-empty string`};return{ok:!0}}function eo(e,t){if(!F(e))return{ok:!1,error:`${t} must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`${t}.id must be a string`};if(typeof e.category!=`string`)return{ok:!1,error:`${t}.category must be a string`};let n=Fa(e.detector,[`known-secret`,`credential-pattern`,`pre-obfuscated`],`${t}.detector`);if(!n.ok)return n;let r=e.target;return F(r)?$a(r,`${t}.target`):{ok:!1,error:`${t}.target must be a non-null object`}}function to(e,t){return F(e)?typeof e.sourceConversationId==`string`?typeof e.targetConversationId==`string`?{ok:!0}:{ok:!1,error:`${t}.targetConversationId must be a string`}:{ok:!1,error:`${t}.sourceConversationId must be a string`}:{ok:!1,error:`${t} must be a non-null object`}}function no(e,t){return typeof e!=`string`||!ka.has(e)?{ok:!1,error:`${t} is not a valid completeness reason`}:{ok:!0}}function ro(e){if(!F(e))return{ok:!1,error:`export must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`export.id must be a string`};if(typeof e.generatedAt!=`string`)return{ok:!1,error:`export.generatedAt must be a string`};if(e.format!==`slicc-transcript`)return{ok:!1,error:`export.format must equal "slicc-transcript"`};let t=e.producer;return F(t)?t.application===`slicc`?typeof t.version==`string`?{ok:!0}:{ok:!1,error:`export.producer.version must be a string`}:{ok:!1,error:`export.producer.application must equal "slicc"`}:{ok:!1,error:`export.producer must be a non-null object`}}function io(e){if(!F(e))return{ok:!1,error:`session.completeness must be a non-null object`};let t=Fa(e.status,[`complete`,`partial`],`session.completeness.status`);return t.ok?Array.isArray(e.missing)?Ia(e.missing,no,`session.completeness.missing`):{ok:!1,error:`session.completeness.missing must be an array`}:t}function ao(e){if(!F(e))return{ok:!1,error:`session must be a non-null object`};if(typeof e.id!=`string`)return{ok:!1,error:`session.id must be a string`};if(typeof e.title!=`string`)return{ok:!1,error:`session.title must be a string`};let t=Fa(e.state,[`active`,`frozen`],`session.state`);return t.ok?io(e.completeness):t}function oo(e){if(!F(e))return{ok:!1,error:`privacy must be a non-null object`};if(e.reasoningExcluded!==!0)return{ok:!1,error:`privacy.reasoningExcluded must be true`};let t=e.excludedReasoningBlocks;if(typeof t!=`number`)return{ok:!1,error:`privacy.excludedReasoningBlocks must be a number`};if(!Number.isInteger(t)||t<0)return{ok:!1,error:`privacy.excludedReasoningBlocks must be a non-negative integer`};if(e.binaryAttachments!==`included-unchanged`)return{ok:!1,error:`privacy.binaryAttachments must equal "included-unchanged"`};if(!F(e.redactionCounts))return{ok:!1,error:`privacy.redactionCounts must be a non-null object`};let n=e.redactions;return Array.isArray(n)?Ia(n,eo,`privacy.redactions`):{ok:!1,error:`privacy.redactions must be an array`}}function so(e){let t=e.conversations;if(!Array.isArray(t))return{ok:!1,error:`conversations must be an array`};let n=Ia(t,Ka,`conversations`);if(!n.ok)return n;let r=e.delegations;if(!Array.isArray(r))return{ok:!1,error:`delegations must be an array`};let i=Ia(r,to,`delegations`);if(!i.ok)return i;let a=e.attachments;return Array.isArray(a)?Ia(a,Qa,`attachments`):{ok:!1,error:`attachments must be an array`}}function co(e){let t=new Set,n=new Set;for(let r of e){if(!F(r)||typeof r.id!=`string`)continue;if(t.has(r.id))return{ok:!1,error:`duplicate conversation id "${r.id}"`};t.add(r.id);let e=r.messages;if(Array.isArray(e)){for(let t of e)if(!(!F(t)||typeof t.id!=`string`)){if(n.has(t.id))return{ok:!1,error:`duplicate message id "${t.id}"`};n.add(t.id)}}}return{ok:!0}}function lo(e){for(let t of e){if(!F(t))continue;let e=t.messages;if(!Array.isArray(e))continue;let n=typeof t.id==`string`?t.id:`?`,r=0;for(let t of e){if(!F(t)||typeof t.sequence!=`number`)continue;let e=t.sequence;if(e<=r)return{ok:!1,error:`sequences in conversation "${n}" must be strictly increasing`};r=e}}return{ok:!0}}function uo(e){let t=[];for(let n of e){if(!F(n))continue;let e=n.content;if(Array.isArray(e))for(let n of e)F(n)&&n.type===`tool-call`&&typeof n.id==`string`&&t.push(n.id)}return t}function fo(e){let t=new Set;for(let n of e){if(!F(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of uo(e))t.add(n)}return t}function po(e,t){for(let n of e){if(!F(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!F(n)||n.role!==`tool-result`)continue;let e=n.toolCallId;if(typeof e==`string`&&e!==``&&!t.has(e))return{ok:!1,error:`tool-result message references unknown toolCallId "${e}"`}}}return{ok:!0}}function mo(e){return po(e,fo(e))}function ho(e,t){for(let n of e){if(!F(n)||n.type!==`attachment-ref`)continue;let e=n.attachmentId;if(typeof e!=`string`||!t.has(e))return{ok:!1,error:`attachment-ref references unknown attachmentId "${e}"`}}return{ok:!0}}function go(e,t){for(let n of e){if(!F(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!F(n))continue;let e=n.content;if(!Array.isArray(e))continue;let r=ho(e,t);if(!r.ok)return r}}return{ok:!0}}function _o(e,t){let n=new Set;for(let e of t)F(e)&&typeof e.id==`string`&&n.add(e.id);return go(e,n)}function vo(e){let t=new Map;for(let n of e){if(!F(n)||typeof n.id!=`string`)continue;let e=new Set,r=n.messages;if(Array.isArray(r))for(let t of r)F(t)&&typeof t.id==`string`&&e.add(t.id);t.set(n.id,e)}return t}function yo(e,t){let n=vo(t);for(let t=0;t<e.length;t++){let r=e[t];if(!F(r))continue;let i=r.sourceConversationId,a=r.sourceMessageId;if(typeof i!=`string`||typeof a!=`string`)continue;let o=n.get(i);if(!o)return{ok:!1,error:`attachments[${t}].sourceConversationId "${i}" does not exist`};if(!o.has(a))return{ok:!1,error:`attachments[${t}].sourceMessageId "${a}" does not exist in conversation "${i}"`}}return{ok:!0}}function bo(e){let t=new Map;for(let n of e){if(!F(n)||typeof n.id!=`string`)continue;let e=Array.isArray(n.messages)?n.messages:[];t.set(n.id,new Set(uo(e)))}return t}function xo(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!F(i))continue;let a=i.sourceConversationId,o=i.targetConversationId;if(typeof a!=`string`||!t.has(a))return{ok:!1,error:`delegations[${r}].sourceConversationId "${a}" does not exist`};if(typeof o!=`string`||!t.has(o))return{ok:!1,error:`delegations[${r}].targetConversationId "${o}" does not exist`};let s=i.toolCallId;if(typeof s==`string`&&s!==``&&!n.get(a)?.has(s))return{ok:!1,error:`delegations[${r}].toolCallId "${s}" does not exist in source conversation "${a}"`}}return{ok:!0}}function So(e,t){let n=new Set;for(let e of t)F(e)&&typeof e.id==`string`&&n.add(e.id);return xo(e,n,bo(t))}function Co(e,t,n){if(e.kind!==`attachment`)return{ok:!0};let r=e.attachmentId;return typeof r!=`string`||!t.has(r)?{ok:!1,error:`${n}.attachmentId "${r}" does not reference a known attachment`}:{ok:!0}}function wo(e,t){let n=new Set;for(let e of t)F(e)&&typeof e.id==`string`&&n.add(e.id);for(let t=0;t<e.length;t++){let r=e[t];if(!F(r))continue;let i=r.target;if(!F(i))continue;let a=Co(i,n,`privacy.redactions[${t}].target`);if(!a.ok)return a}return{ok:!0}}function To(e){let t=e.conversations,n=e.attachments,r=e.delegations,i=e.privacy,a=Array.isArray(i?.redactions)?i.redactions:[],o=co(t);if(!o.ok)return o;let s=lo(t);if(!s.ok)return s;let c=mo(t);if(!c.ok)return c;let l=_o(t,n);if(!l.ok)return l;let u=yo(n,t);if(!u.ok)return u;let d=So(r,t);return d.ok?wo(a,n):d}function Eo(e){let t=so(e);return t.ok?To(e):t}function Do(e){if(!F(e))return{ok:!1,error:`document must be a non-null object`};if(e.schemaVersion!==1)return{ok:!1,error:`schemaVersion must equal 1`};let t=ro(e.export);if(!t.ok)return t;let n=ao(e.session);if(!n.ok)return n;let r=oo(e.privacy);return r.ok?Eo(e):r}async function Oo(e,t,n){let r=await n({method:`GET`,path:`/${e}/sites/${t}/config.json`,origin:Ke});if(r.status===401||r.status===403)throw Error(`not authorized to read the site config for ${e}/${t} — log in via Settings → Providers → Adobe, or pass --backend to skip the probe`);if(r.status===404)throw Error(`no site config for ${e}/${t} — check the org and site names`);if(r.status>=400)throw Error(`site config probe failed for ${e}/${t}: ${r.status}`);let i;try{i=await r.json()}catch(n){throw Error(`site config for ${e}/${t} is not JSON: ${n instanceof Error?n.message:String(n)}`)}let a=i.content?.source?.url;return{backend:ko(a),sourceUrl:a}}function ko(e){if(!e)return`da`;let t;try{t=new URL(e).host}catch{return`da`}return t===`api.aem.live`?`aem`:`da`}const Ao=`slicc-sprinkle-routes`;function jo(){try{let e=localStorage.getItem(Ao);return e?JSON.parse(e):{}}catch{return{}}}function Mo(e){try{localStorage.setItem(Ao,JSON.stringify(e))}catch{}}function No(e){return jo()[e]}function Po(e,t){let n=jo();n[e]=t,Mo(n)}function Fo(e){let t=jo();delete t[e],Mo(t)}function Io(){return jo()}function Lo(e,t,n){return _t(t,n,`${e} adapter does not implement ${t}.${n}`)}function Ro(e,t,n,r){let i=n.filter(e=>typeof r?.[e]==`function`),a=n.map(n=>{let i=r?.[n];return[n,typeof i==`function`?i:()=>Promise.resolve(Lo(e,t,n))]});return{...Object.fromEntries(a),allowlist:i,supports:e=>i.includes(e)}}function zo(e){let{adapter:t,pageGestures:n}=e,r=n??{};return{adapter:t,browser:Ro(t,`browser`,bt,e.browser),network:Ro(t,`network`,gt,e.network),secrets:Ro(t,`secrets`,xt,e.secrets),devices:Ro(t,`devices`,St,{usbRequest:r.usbRequest,serialRequest:r.serialRequest,hidRequest:r.hidRequest,...e.devices}),mounts:Ro(t,`mounts`,vt,{pickDirectory:r.pickDirectory,...e.mounts}),approvals:Ro(t,`approvals`,Ct,e.approvals)}}function Bo(e={}){return zo({adapter:`connect`,pageGestures:e.pageGestures})}function Vo(e){let t=wt(()=>import(`./extension-ops-CF2mLDRW.js`).then(t=>t.createExtensionOps(e)));return zo({adapter:e.adapter,pageGestures:e.pageGestures,network:{crossOriginFetch:e=>T(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>T(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>T(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>T(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>T(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>T(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>T(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function Ho(e={}){let t=wt(()=>import(`./rest-ops-CLliBy-9.js`).then(t=>t.createRestOps(e)),e.controlTimeoutMs??1e4);return zo({adapter:`node-rest`,pageGestures:e.pageGestures,network:{localNodeServer:()=>Promise.resolve({ok:!0,value:{available:!0}}),crossOriginFetch:e=>T(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>T(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>T(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>T(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>T(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>T(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>T(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function Uo(e,t={}){let{pageGestures:n}=t;switch(e){case`node-rest`:return Ho({pageGestures:n});case`extension-direct`:case`extension-delegate`:return Vo({adapter:e,pageGestures:n});case`connect`:return Bo({pageGestures:n})}}const Wo=e(`quick-llm`);async function Go(e){let t=d();if(!t)return Wo.debug(`No API key for active provider — skipping`),null;let n=u(),r=l(),i;if(i=e.modelId?Yo(n,e.modelId)??Yo(n,r):Ko(n,r),!i)return Wo.debug(`No model available for provider`,{providerId:n}),null;let a={role:`user`,content:e.prompt,timestamp:Date.now()},o={};i.provider===`adobe`&&(o[`X-Session-Id`]=Xo());try{let n=(await Se(i,{systemPrompt:e.system,messages:[a]},{apiKey:t,maxTokens:e.maxTokens??60,temperature:e.temperature??.3,signal:e.signal,headers:Object.keys(o).length>0?o:void 0})).content.filter(e=>e.type===`text`).map(e=>e.text).join(``).trim();return n.length>0?n:null}catch(e){return Wo.debug(`Quick label call failed`,{error:e instanceof Error?e.message:String(e)}),null}}function Ko(e,t){let n=f(e);if(n.length===0)return;let r=n.find(e=>e.id===t)??n[0],i=Jo(r.id),a=n.filter(e=>qo(e,r,i));return a.length===0?r:(a.sort((e,t)=>(e.cost?.input??0)-(t.cost?.input??0)),a[0])}function qo(e,t,n){if(e.id===t.id)return!1;let r=t.cost?.input??1/0;if((e.cost?.input??1/0)>=r)return!1;let i=e.id.toLowerCase();switch(n){case`claude`:return i.includes(`haiku`);case`gpt`:return/(^|-)mini(-|$)|(^|-)nano(-|$)/.test(i);case`gemini`:return i.includes(`flash`);case`grok`:return/(^|-)mini(-|$)|(^|-)fast(-|$)/.test(i);case`unknown`:return!0}}function Jo(e){let t=e.toLowerCase();return t.includes(`claude`)?`claude`:t.includes(`gemini`)?`gemini`:t.includes(`grok`)?`grok`:/^(gpt|o\d)/.test(t)?`gpt`:`unknown`}function Yo(e,t){return f(e).find(e=>e.id===t)}function Xo(){return Et(`ui-quick-llm`)}const Zo=e(`sudo-suggest`),Qo=[`You generalize a single shell command into a minimal glob pattern for an`,`allow-list rule. Output ONLY the pattern on one line — no prose, no quotes,`,`no backticks. Keep the leading command/sub-command verbatim and replace only`,`the volatile tail (args, paths, refs) with a single trailing "*".`,`Examples:`,` git push origin main -> git push*`,` rm -rf build/cache -> rm -rf*`,` npm install left-pad -> npm install*`].join(`
|
|
2
2
|
`),$o=[`You generalize a single filesystem path into a minimal glob pattern for an`,`allow-list rule. Output ONLY the pattern on one line — no prose, no quotes,`,`no backticks. Keep the meaningful directory prefix and replace the volatile`,`leaf (and below) with "**". Examples:`,` /workspace/.git/config -> /workspace/.git/**`,` /shared/secrets/openai.key -> /shared/secrets/**`,` /workspace/src/app/main.ts -> /workspace/src/**`].join(`
|
|
3
3
|
`);async function es(e,t){if(e.suggestedPattern&&e.suggestedPattern.trim().length>0)return e.suggestedPattern.trim();let n=e.detail.trim(),r=e.kind===`command`?Qo:$o,i=null;try{i=await Go({prompt:n,system:r,maxTokens:40,temperature:0,signal:t})}catch(e){Zo.debug(`suggestPattern: quickLabel threw`,{error:e instanceof Error?e.message:String(e)}),i=null}return ts(i)||n}function ts(e){if(!e)return null;let t=(e.split(`
|
|
4
4
|
`,1)[0]?.trim()??``).replace(/^`+/,``).replace(/`+$/,``).replace(/^["']/,``).replace(/["']$/,``).trim();return t.length===0?null:t}const ns=e(`sudo:capability-gesture`);function rs(e,t={}){let n=t.suggest??es;return{async requestApproval(t,r){let i=r?.signal,a;if(t.suggestedPattern)a=t.suggestedPattern;else try{a=await n(t,i)}catch{a=t.detail}if(i?.aborted)return ns.warn(`sudo approval aborted before prompting — denying`,{detail:t.detail}),{decision:`deny`};if(!e)return ns.warn(`no CapabilityBroker injected for the sudo gesture hop — denying (composition bug, never a guessed transport)`,{detail:t.detail}),{decision:`deny`};let o=await e.approvals.request({kind:t.kind,detail:t.detail,suggestedPattern:a,...t.requester?{requester:t.requester}:{},...t.reason?{reason:t.reason}:{},...t.approver?{approver:t.approver}:{},...i?{signal:i}:{}});return o.ok?yt(o.value,a):(ns.warn(`capability broker approvals.request failed — denying`,{message:o.message}),{decision:`deny`})}}}const is=e(`sudo:tray-first`);function as(e,t={}){let n=t.suggest??es,r=t.timeoutMs??6e5,i=t.getClient??(async()=>{let{getPanelRpcClient:e}=await import(`./panel-rpc-DW7W4w6_.js`).then(e=>e.a);return e()});return{async requestApproval(t,a){if(a?.signal?.aborted)return{decision:`deny`};let o=t.suggestedPattern;if(!o)try{o=await n(t,a?.signal)}catch{o=t.detail}let s={...t,suggestedPattern:o},c=null;try{c=await i()}catch(e){is.debug?.(`panel-RPC client lookup threw — using native broker`,{error:e instanceof Error?e.message:String(e)})}if(c)try{let e=await c.call(`sudo-request`,{request:s,mode:`tray-first`},{timeoutMs:r});if(e?.handled!==!1)return os(e?.decision,o)}catch(e){is.warn(`tray-first sudo probe failed — using native broker`,{error:e instanceof Error?e.message:String(e)})}return e.requestApproval(s,a)}}}function os(e,t){if(!e||typeof e!=`object`)return{decision:`deny`};let n=e,r=n.attestation===`biometric`||n.attestation===`passcode`||n.attestation===`none`?n.attestation:void 0;return n.decision===`allow`?{decision:`allow`,...r?{attestation:r}:{}}:n.decision===`always`?{decision:`always`,pattern:typeof n.pattern==`string`&&n.pattern.trim().length>0?n.pattern.trim():t,...r?{attestation:r}:{}}:{decision:`deny`}}function ss(e,t){return{requestApproval(n){return t.enqueueSudoRequest(e,n)}}}function cs(){return`lick-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}var ls=class{pending=new Map;timeoutMs;newId;setTimer;clearTimer;onAutoSettle;constructor(e={}){this.timeoutMs=e.timeoutMs??3e5,this.newId=e.newId??cs,this.setTimer=e.setTimer??((e,t)=>setTimeout(e,t)),this.clearTimer=e.clearTimer??(e=>clearTimeout(e)),this.onAutoSettle=e.onAutoSettle??(()=>{})}notifyAutoSettle(e,t,n){try{this.onAutoSettle(e,t,n)}catch{}}register(e,t,n){let r=this.newId();return{id:r,pending:new Promise(i=>{let a=null;Number.isFinite(this.timeoutMs)&&this.timeoutMs>0&&(a=this.setTimer(()=>{let e=this.pending.get(r);e&&(this.pending.delete(r),e.resolve(pt(`cone-timeout`)),this.notifyAutoSettle(r,`expired`,e.scoopJid))},this.timeoutMs)),this.pending.set(r,{scoopJid:e,request:t,resolve:i,timerHandle:a,approverJid:n})})}}resolve(e,t){let n=this.pending.get(e);return n?(this.pending.delete(e),n.timerHandle!=null&&this.clearTimer(n.timerHandle),n.resolve(t),!0):!1}failScoop(e){let t=0;for(let[n,r]of this.pending)r.scoopJid===e&&(this.pending.delete(n),r.timerHandle!=null&&this.clearTimer(r.timerHandle),r.resolve({decision:`deny`}),this.notifyAutoSettle(n,`scoop-dropped`,r.scoopJid),t++);return t}failAll(){let e=0;for(let[t,n]of this.pending)n.timerHandle!=null&&this.clearTimer(n.timerHandle),n.resolve({decision:`deny`}),this.notifyAutoSettle(t,`shutdown`,n.scoopJid),e++;return this.pending.clear(),e}get(e){let t=this.pending.get(e);return t?{id:e,scoopJid:t.scoopJid,request:t.request,...t.approverJid?{approverJid:t.approverJid}:{}}:null}list(){let e=[];for(let[t,n]of this.pending)e.push({id:t,scoopJid:n.scoopJid,request:n.request,...n.approverJid?{approverJid:n.approverJid}:{}});return e}size(){return this.pending.size}};e(`sudo-panel`),typeof globalThis.confirm==`function`&&globalThis.confirm.bind(globalThis),typeof globalThis.prompt==`function`&&globalThis.prompt.bind(globalThis),e(`sudo:page`),e(`sudo`);function us(e){return mt(ds(e))}function ds(e){let t=rs(e);return e?.adapter===`extension-direct`||e?.adapter===`extension-delegate`?t:as(t)}let fs=null;function ps(e){return fs=e,()=>{fs===e&&(fs=null)}}function ms(){if(!fs)throw new Oa(`session-not-found`);return fs}const hs=`focus`,gs={type:`leaf`,surfaceId:`chat`};function _s(e,t={},n={}){return{zones:{top:null,left:null,middle:null,right:null,bottom:null,...e},rowFr:{top:1,center:1,bottom:1,...n},colFr:{left:1,middle:1,right:1,...t}}}const vs={focus:{name:`focus`,tree:_s({left:gs},{left:3,middle:1})}};function ys(e){return vs[e]??null}const bs=`progress`;function xs(e){return/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}async function Ss(){try{let e=await jt();if(e.cancelled)throw Error(`mount: cancelled`);if(e.error)throw Error(`mount: ${e.error}`);if(e.handleInIdb&&typeof e.idbKey==`string`){let t=await Mt(e.idbKey);if(!t)throw Error(`mount: no directory handle found in storage`);return await At(t),t}throw Error(`mount: unexpected popup result`)}catch(e){throw Error(`mount: ${e instanceof Error?e.message:String(e)}`)}}async function Cs(){if(typeof window>`u`||!(`showDirectoryPicker`in window))throw Error(`mount: local picker requires a user gesture in the panel (unavailable in this runtime). Ask the agent to mount it instead.`);try{return await window.showDirectoryPicker({mode:`readwrite`})}catch(e){throw e instanceof Error&&e.name===`AbortError`?Error(`mount: cancelled`):Error(`mount: ${e instanceof Error?e.message:String(e)}`)}}function ws(e){let t={positional:[],noProbe:!1,clearCache:!1,bodies:!1,json:!1};for(let n=0;n<e.length;n++){let r=e[n];if(r===`--source`)t.source=e[++n];else if(r===`--profile`)t.profile=e[++n];else if(r===`--backend`){let r=e[++n];r===`da`||r===`aem`?t.backend=r:t.backendError=r}else r===`--no-probe`?t.noProbe=!0:r===`--max-body-mb`?t.maxBodyMb=Number(e[++n]):r===`--clear-cache`?t.clearCache=!0:r===`--bodies`?t.bodies=!0:r===`--json`?t.json=!0:t.positional.push(r)}return t}function Ts(e){let t=e.match(/^(da|aem):\/\/([^/]+)\/([^/]+)(?:\/(.*))?$/);return t?{scheme:t[1],org:t[2],name:t[3],path:(t[4]??``).replace(/^\/+/,``).replace(/\/+$/,``)}:null}const Es=new Set([`--source`,`--profile`,`--backend`,`--max-body-mb`]);function Ds(e){for(let t=0;t<e.length;t++){let n=e[t];if(n===`--`)return!1;if(n===`--help`||n===`-h`)return!0;Es.has(n)&&t++}return!1}function Os(e){return`aem://${e.org}/${e.name}${e.path?`/${e.path}`:``}`}var ks=class{options;signedFetchS3;signedFetchDa;constructor(e){this.options=e,this.signedFetchS3=e.signedFetchS3,this.signedFetchDa=e.signedFetchDa}async execute(e,t,n){let r=e[0];if(r===`--help`||r===`-h`)return this.help();if(r===`unmount`||r===`-u`)return this.handleUnmount(e.slice(1),t,`mount unmount`);if(r===`list`||r===`-l`||r===`--list`)return this.handleList();if(r===`refresh`)return this.handleRefresh(e.slice(1),t,n);if(r===`info`)return this.handleInfo(e.slice(1),t);let i=ws(e);if(i.positional.length===0)return this.usageError(`mount: mount point required`);let a=this.resolvePath(i.positional[0],t);return i.backendError===void 0?i.source?i.source.startsWith(`s3://`)?this.mountS3(a,i):i.source.startsWith(`da://`)||i.source.startsWith(`aem://`)?this.mountAdobe(a,i):this.usageError(`mount: invalid source '${i.source}' — expected s3://..., da://... or aem://...`):this.mountLocal(a,n):this.usageError(`mount: invalid --backend '${i.backendError}' — expected 'da' or 'aem'`)}async executeUmount(e,t){return this.handleUnmount(e,t,`umount`)}async mountLocal(e,t){try{if((this.options.isScoop??(()=>!1))())throw Error(`mount: cannot mount local directories from a scoop (no UI). Ask the cone.`);let n=Oe();if(!n){let n=await As(e);if(n)return await this.options.fs.mount(e,n,{env:t}),{stdout:`Mounted '${n.describe().displayName}' → ${e}\nIndexing in background for fast file discovery.\nNote: External changes are not auto-detected — use 'mount refresh ${e}' after modifying files outside the browser.\n`,stderr:``,exitCode:0}}let r;if(n){let t=this.options.acquireLocalMountViaToolUI;if(!t)throw Error(`mount: tool UI not available in this runtime`);r=await t(n,e)}else r=v()?await Ss():await Cs();let i=He.fromHandle(r,{mountId:Ye()});return await this.options.fs.mount(e,i,{env:t}),{stdout:`Mounted '${i.describe().displayName}' → ${e}\nIndexing in background for fast file discovery.\nNote: External changes are not auto-detected — use 'mount refresh ${e}' after modifying files outside the browser.\n`,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`mount: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}async mountS3(e,t){if(!t.source)return this.usageError(`mount: --source required`);let n=t.profile??`default`,r=Ye(),i=new Xe({mountId:r,ttlMs:3e4}),a=new We({source:t.source,profile:n,cache:i,maxBodyBytes:t.maxBodyMb?t.maxBodyMb*1024*1024:void 0,mountId:r,signedFetch:this.signedFetchS3??Ge(n)});if(!t.noProbe)try{await a.readDir(`/`)}catch(e){return await a.close(),{stdout:``,stderr:`mount: probe failed for ${t.source} — ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}return await this.options.fs.mount(e,a),{stdout:`Mounted '${a.describe().displayName}' → ${e} (profile: ${n})\n`,stderr:``,exitCode:0}}async mountAdobe(e,t){if(!t.source)return this.usageError(`mount: --source required`);let n=t.profile??`default`,r=this.signedFetchDa??Je(),i=Ts(t.source);if(!i)return this.usageError(`mount: invalid source '${t.source}' — expected da://org/repo or aem://org/site`);let a=i.scheme===`aem`?`aem`:`da`,o=``;if(t.backend)a=t.backend;else if(i.scheme===`da`)try{a=(await Oo(i.org,i.name,r)).backend,a===`aem`&&(o=`mount: ${i.org}/${i.name} is on Helix 6 — its content lives in the Source Bus at https://api.aem.live/${i.org}/sites/${i.name}/source, not admin.da.live. Mounting through aem://${i.org}/${i.name}. Pass --backend da to force the old endpoint.\n`)}catch(e){return{stdout:``,stderr:`mount: could not determine the content source for ${t.source} — ${e instanceof Error?e.message:String(e)}. Pass --backend da or --backend aem to skip this probe.\n`,exitCode:1}}let s=Ye(),c=new Xe({mountId:s,ttlMs:3e4}),l={source:a===`aem`?Os(i):`da://${i.org}/${i.name}${i.path?`/${i.path}`:``}`,profile:n,cache:c,maxBodyBytes:t.maxBodyMb?t.maxBodyMb*1024*1024:void 0,mountId:s,signedFetch:r},u=a===`aem`?new qe(l):new Ue(l);if(!t.noProbe)try{await u.readDir(`/`)}catch(e){return await u.close(),{stdout:``,stderr:o+`mount: probe failed for ${l.source} — ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}return await this.options.fs.mount(e,u),{stdout:`Mounted '${u.describe().displayName}' → ${e} (profile: ${n})\n`,stderr:o,exitCode:0}}async handleUnmount(e,t,n){if(Ds(e))return n===`umount`?this.umountHelp():this.help();let r=ws(e);if(r.positional.length===0)return{stdout:``,stderr:`${n}: path required\n`,exitCode:1};let i=this.resolvePath(r.positional[0],t);try{let e,t;if(r.clearCache){let{getAllMountEntries:n}=await import(`./mount-table-store-DrF_Ifaz.js`).then(e=>e.r),r=(await n()).find(e=>e.targetPath===i),a=r?.descriptor.kind;r&&(a===`s3`||a===`da`||a===`aem`)&&(e=r.descriptor.mountId,t=r.descriptor.kind)}await this.options.fs.unmount(i);let n=``;if(r.clearCache&&e&&t){let{RemoteMountCache:t}=await import(`./remote-cache-UwMD8EkX.js`).then(e=>e.n);await new t({mountId:e,ttlMs:3e4}).clearMount(),n=` (cache cleared)`}else r.clearCache&&(n=` (no remote cache to clear)`);return{stdout:`Unmounted ${i}${n}\n`,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`${n}: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}async handleList(){try{let e=this.options.fs.listMounts();if(e.length===0)return{stdout:`No active mounts
|
|
@@ -279,7 +279,7 @@ Examples:
|
|
|
279
279
|
skill list
|
|
280
280
|
skill info bluebubbles
|
|
281
281
|
skill read bluebubbles
|
|
282
|
-
`,stderr:``,exitCode:0};let r=t[0],i=await import(`./kernel-worker-
|
|
282
|
+
`,stderr:``,exitCode:0};let r=t[0],i=await import(`./kernel-worker-iJeImuDy.js`).then(e=>e.r);try{switch(r){case`list`:return ah(t,e,i,n.env.get(`PATH`));case`info`:{let n=t[1];if(!n)return{stdout:``,stderr:`skill: info requires a skill name
|
|
283
283
|
`,exitCode:1};let r=await i.getSkillInfo(e,n);return r?{stdout:rh(r),stderr:``,exitCode:0}:{stdout:``,stderr:`skill: "${n}" not found\n`,exitCode:1}}case`read`:{let n=t[1];if(!n)return{stdout:``,stderr:`skill: read requires a skill name
|
|
284
284
|
`,exitCode:1};let r=await i.readSkillInstructions(e,n);return r===null?{stdout:``,stderr:`skill: no SKILL.md found for "${n}"\n`,exitCode:1}:{stdout:r+`
|
|
285
285
|
`,stderr:``,exitCode:0}}default:return{stdout:``,stderr:`skill: unknown command "${r}"\n`,exitCode:1}}}catch(e){return{stdout:``,stderr:`skill: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}})}const sh=[{names:[`--branch`,`-b`],validate:e=>!e.startsWith(`-`)&&i(e),error:`upskill: --branch must be a git ref of [A-Za-z0-9._/-]+ with no "..", leading "-"/"/", trailing "/" or ".lock", or shell metacharacters`,apply:(e,t)=>{e.branch=t}},{names:[`--from`],validate:e=>Pi(e)!==null,error:`upskill: --from requires a GitHub source (owner/repo, owner/repo@branch, or a github.com URL)`,apply:(e,t)=>{e.from=t}},{names:[`--path`,`-p`],validate:e=>o(e),error:`upskill: --path must be a repo-relative sub-path of [A-Za-z0-9._/-]+ with no "..", leading "-"/"/", or shell metacharacters`,apply:(e,t)=>{e.path=t}}];function ch(e){let t={skills:[],dryRun:!1,json:!1};for(let n=0;n<e.length;n++){let r=e[n],i=sh.find(e=>e.names.includes(r));if(i){let r=e[++n];if(!r||!i.validate(r))return t.error=i.error,t;i.apply(t,r)}else if(r===`--dry-run`||r===`-n`)t.dryRun=!0;else if(r===`--json`)t.json=!0;else if(r.startsWith(`-`))return t.error=`upskill: unknown option "${r}" for update`,t;else t.skills.push(r)}return t}function lh(e,t){return!e||!t||e.byteLength!==t.byteLength?!1:e.every((e,n)=>e===t[n])}async function uh(e,t){try{let n=await e.readFile(t,{encoding:`binary`});return n instanceof Uint8Array?n:new TextEncoder().encode(String(n))}catch{return}}async function dh(e,t,n,r){let i=await uh(e,t);return bi(n)?i?{status:`kept-local`,write:!1}:{status:`added`,write:!0}:i?lh(i,r)?{status:`unchanged`,write:!1}:{status:`updated`,write:!0}:{status:`added`,write:!0}}async function fh(e,t,n,r){let i={changes:[],writes:[],removals:[]};for(let[r,a]of n){let n=`${t}/${r}`,{status:o,write:s}=await dh(e,n,r,a);i.changes.push({path:r,status:o}),s&&i.writes.push({path:n,content:a})}let a=new Set(r.files??[]);for(let r of await xi(e,t)){if(n.has(r))continue;let e=a.has(r);i.changes.push({path:r,status:e?`removed`:`kept-local`}),e&&i.removals.push(`${t}/${r}`)}return i.changes.sort((e,t)=>e.path.localeCompare(t.path)),i}async function ph(e,t,n,r,i,a){let o={skill:n,source:`${r.kind}:${r.source}`,ref:i??r.ref,from:r.sha,outcome:`current`,changes:[]},[s,c]=r.source.split(`/`);if(!s||!c)return{...o,outcome:`error`,error:`unusable source "${r.source}"`};let l=(r.path??``).replace(/^\/|\/$/g,``),u=await Ei(t),d=await Oi(s,c,o.ref,u,!0,l||void 0);if(d&&r.sha===d&&await mh(e,n,r))return{...o,to:d,outcome:`current`,changes:[]};let f=await hh(s,c,l,n,o.ref,t,u);if(`error`in f)return{...o,outcome:`error`,error:f.error};let p=f.files,m=f.path;if(p.size===0)return{...o,outcome:`error`,error:`no files at ${s}/${c}${m?`/${m}`:``} — the skill may have moved or been removed upstream`};let{changes:h,writes:g,removals:_}=await fh(e,`${pi}/${n}`,p,r),v=g.length>0||_.length>0;if(a)return{...o,outcome:v?`updated`:`current`,changes:h};let ee=d??r.sha;return v&&await bh(e,{changes:h,writes:g,removals:_}),await ki(e,n,{...r,ref:o.ref,path:m,sha:ee,files:[...p.keys()].sort()}),{...o,to:ee,outcome:v?`updated`:`current`,changes:h}}async function mh(e,t,n){if(!n.files?.length)return!1;for(let r of n.files)if(!await e.exists(`/workspace/skills/${t}/${r}`))return!1;return!0}async function hh(e,t,n,r,i,a,o){let s=await Ci(e,t,a,i??`main`);if(s.status===`ok`){let i=vi(s.files),a=n||gh(i,r);return a===null?{error:`could not find "${r}/SKILL.md" in ${e}/${t} — pass --path <dir> to say where the skill lives`}:{files:yh(i,a),path:a}}try{return{files:vh(_h(await Si(e,t,n,i,o))),path:n}}catch(e){let t=e instanceof Error?e.message:String(e);return{error:`${s.message}; Contents API fallback failed: ${t}`}}}function gh(e,t){let n=[];for(let r of Object.keys(e))r===`SKILL.md`?n.push(``):(r.endsWith(`/${t}/SKILL.md`)||r===`${t}/SKILL.md`)&&n.push(r.slice(0,-9));return n.length===0?null:(n.sort((e,t)=>e.split(`/`).length-t.split(`/`).length||e.localeCompare(t)),n[0])}function _h(e){return new Map([...e].filter(([e])=>yi(e)))}function vh(e){return new Map([...e].sort(([e],[t])=>e.localeCompare(t)))}function yh(e,t){let n=t?`${t}/`:``,r=new Map;for(let[t,i]of Object.entries(e)){if(!t.startsWith(n)||t.endsWith(`/`))continue;let e=t.slice(n.length);yi(e)&&r.set(e,i)}return vh(r)}async function bh(e,t){for(let n of t.writes){let t=n.path.slice(0,n.path.lastIndexOf(`/`));await e.mkdir(t,{recursive:!0}),await e.writeFile(n.path,n.content)}for(let n of t.removals)await e.rm(n).catch(()=>{})}async function xh(e,t,n,r,i){let a={skill:n,source:`${r.kind}:${r.source}`,outcome:`current`,changes:[]},[o,s]=r.source.split(`/`);if(!o||!s)return{...a,outcome:`error`,error:`unusable source "${r.source}"`};let c=await Qm(o,s,t);if(!c.ok)return{...a,outcome:`error`,error:c.error};let l=`${pi}/${n}/SKILL.md`,u=await uh(e,l),d=new TextEncoder().encode(c.content),f=u!==void 0&&Xm(new TextDecoder().decode(u))===Xm(c.content);if(lh(u,d)||f)return{...a,changes:[{path:`SKILL.md`,status:`unchanged`}]};let p=u?`updated`:`added`;return i||(await e.mkdir(`${pi}/${n}`,{recursive:!0}),await e.writeFile(l,d),await ki(e,n,{...r,files:[`SKILL.md`]})),{...a,outcome:`updated`,changes:[{path:`SKILL.md`,status:p}]}}function Sh(e,t){if(e.outcome===`error`)return` ${e.skill}: failed — ${e.error}\n`;let n=new Map;for(let t of e.changes)n.set(t.status,(n.get(t.status)??0)+1);let r=e.to&&e.to!==e.from?` → ${e.to.slice(0,7)}`:``;if(e.outcome===`current`)return` ${e.skill}: already current (${e.source}${r})\n`;let i=t?`would update`:`updated`,a=` ${e.skill}: ${i} from ${e.source}${r}\n`;for(let t of e.changes)t.status!==`unchanged`&&(a+=` ${t.status.padEnd(10)} ${t.path}\n`);let o=n.get(`kept-local`)??0;return o>0&&(a+=` (${o} kept-local — dotfiles and local additions are never touched)\n`),a}function Ch(e,t,n,r){let i=Pi(t);return i?{version:1,kind:`github`,source:`${i.owner}/${i.repo}`,skill:e,ref:r??i.branch,path:n??i.path,installed:new Date().toISOString()}:null}async function wh(e,t,n){if(t.length===0){let t=await Di(e);return{targets:t.provenanced,missing:[],skipped:t.unattributed}}let r=[],i=[];for(let a of t){let t=await Ai(e,a);if(t){r.push({name:a,provenance:t});continue}if(!await e.exists(`/workspace/skills/${a}`)){i.push({name:a,reason:`not-installed`});continue}let o=n.from?Ch(a,n.from,n.path,n.branch):null;o?r.push({name:a,provenance:o}):i.push({name:a,reason:`no-provenance`})}return{targets:r,missing:i,skipped:[]}}function Th(e){return e.reason===`not-installed`?`upskill: no skill named "${e.name}" is installed — check \`upskill list\`
|
|
@@ -290,7 +290,7 @@ Examples:
|
|
|
290
290
|
`}function Oh(e,t,n,r,i){let a=t?`Skill update (dry run — nothing written):
|
|
291
291
|
`:`Skill update:
|
|
292
292
|
`;for(let n of e)a+=Sh(n,t);if(i.length>0&&(a+=Dh(i)),!n&&r&&e.length>0){let n=i.length>0?`all ${Eh(e.length,`skill`)} with provenance ${e.length===1?`is`:`are`}`:`all skills are`;a+=t?`\n${n.charAt(0).toUpperCase()}${n.slice(1)} current.\n`:`\nNothing to update — ${n} current.\n`}return a}async function kh(e,t,n){let{targets:r,missing:i,skipped:a}=await wh(e,n.skills,{skills:n.skills,dryRun:n.dryRun,json:!1,branch:n.branch,from:n.from,path:n.path}),o=[];for(let i of r)o.push(i.provenance.kind===`browse.sh`?await xh(e,t,i.name,i.provenance,n.dryRun):await ph(e,t,i.name,i.provenance,n.branch,n.dryRun));return{results:o,skipped:a,missing:i}}async function Ah(e,t,n){let r=ch(e);if(r.error)return{stdout:``,stderr:`${r.error}\n`,exitCode:1};let{results:i,missing:a,skipped:o}=await kh(t,n,r);if(i.length===0)return a.length===0&&o.length>0?{stdout:r.json?`${JSON.stringify({ok:!0,dryRun:r.dryRun,results:[],skipped:o})}\n`:Oh([],r.dryRun,!1,!0,o),stderr:``,exitCode:0}:{stdout:``,stderr:a.length?a.map(Th).join(``):"upskill: no skill has install provenance yet — reinstall a skill, or run `upskill update <skill> --from <owner>/<repo>`, to record its source\n",exitCode:1};let s=i.filter(e=>e.outcome===`error`),c=i.some(e=>e.outcome===`updated`);c&&!r.dryRun&&await Ni();let l=a.map(Th).join(``)+s.map(e=>`upskill: ${e.skill}: ${e.error}\n`).join(``),u=s.length===0&&a.length===0;return r.json?{stdout:`${JSON.stringify({ok:u,dryRun:r.dryRun,results:i,skipped:o})}\n`,stderr:l,exitCode:+!u}:{stdout:Oh(i,r.dryRun,c,u,o),stderr:l,exitCode:+!u}}function jh(e){let t={outdated:!1,json:!1};for(let n of e)if(n===`--outdated`)t.outdated=!0;else if(n===`--json`)t.json=!0;else if(n.startsWith(`-`))return t.error=`upskill: unknown option "${n}" for list`,t;else return t.error=`upskill: unexpected argument "${n}" for list`,t;return t}function Mh(e){return e.to&&e.from&&e.to!==e.from?` ${e.from.slice(0,7)} → ${e.to.slice(0,7)}`:e.to?` ${e.to.slice(0,7)}`:``}function Nh(e,t){let n=e.filter(e=>e.outcome===`updated`),r=[];if(n.length===0)r.push(`No outdated skills.`);else{r.push(`Outdated skills:`,``);for(let e of n)r.push(` ${e.skill} ${e.source}${Mh(e)}`)}if(t.length>0){let e=t.length===1?`skill`:`skills`;r.push(``,`Skipped ${t.length} ${e} with no install provenance — not checked.`)}let i=e.filter(e=>e.outcome===`error`);if(i.length>0){let e=i.length===1?`skill`:`skills`;r.push(``,`Could not check ${i.length} ${e}:`);for(let e of i)r.push(` ${e.skill}: failed — ${e.error}`)}return`${r.join(`
|
|
293
|
-
`)}\n`}async function Ph(e,t,n){let r=await(await import(`./kernel-worker-
|
|
293
|
+
`)}\n`}async function Ph(e,t,n){let r=await(await import(`./kernel-worker-iJeImuDy.js`).then(e=>e.r)).discoverSkills(e),{collisions:i}=await Zn(e,Jn(n));return t?{stdout:`${JSON.stringify({ok:!0,skills:r,commandCollisions:i})}\n`,stderr:``,exitCode:0}:r.length===0?{stdout:`No discoverable local skills found.\n\n${eh()}`,stderr:``,exitCode:0}:{...Qn(`upskill`,nh(r,`Discoverable local skills`),i,{builtinNames:new Set(rt())}),exitCode:0}}async function Fh(e,t,n){let{results:r,skipped:i}=await kh(e,t,{skills:[],dryRun:!0}),a=r.filter(e=>e.outcome===`updated`),o=r.filter(e=>e.outcome===`error`),s=o.length===0,c=o.map(e=>`upskill: ${e.skill}: ${e.error}\n`).join(``);return n?{stdout:`${JSON.stringify({ok:s,results:[...a,...o],skipped:i})}\n`,stderr:c,exitCode:+!s}:{stdout:Nh(r,i),stderr:c,exitCode:+!s}}async function Ih(e,t,n,r){let i=jh(e);return i.error?{stdout:``,stderr:`${i.error}\n`,exitCode:1}:i.outdated?Fh(t,n,i.json):Ph(t,i.json,r)}async function Lh(e,t){let n=`${mi}/experimental/search?q=${encodeURIComponent(e)}&contentType=skills&page%5Bsize%5D=20`,r;try{r=await t(n,{headers:{Accept:`application/json`}})}catch(e){throw Error(Ti(e,n))}if(r.status!==200)throw Error(`Tessl returned HTTP ${r.status}`);let i=_e(r.body);if(!i.data)return[];let a=new Map;for(let e of i.data){if(e.type!==`skill`)continue;let t=e.attributes,n=Mi(t.sourceUrl),r=n?`${n.owner}/${n.repo}`:void 0,i=t.scores.aggregate==null?null:Math.round(t.scores.aggregate*100),o=t.sourceUrl||e.id,s=a.get(o);if(s&&s.qualityScore!=null&&i!=null&&s.qualityScore>=i)continue;let c=t.path.replace(/\/SKILL\.md$/i,``),l=c.split(`/`).pop()||t.name,u=n?`upskill ${n.owner}/${n.repo} --path ${c.split(`/`).slice(0,-1).join(`/`)||`.`} --skill ${l}`:`upskill tessl:${t.name}`;a.set(o,{name:t.name,displayName:t.name,summary:t.description||``,source:`tessl`,qualityScore:i,installHint:u,featured:t.featured,sourceRepo:r})}return Array.from(a.values())}async function Rh(e,t){let n=`${mi}/experimental/search?q=${encodeURIComponent(e)}&contentType=skills&page%5Bsize%5D=5`,r;try{r=await t(n,{headers:{Accept:`application/json`}})}catch(e){return{error:`Tessl search failed: ${Ti(e,n)}`}}if(r.status!==200)return{error:`Tessl search failed (HTTP ${r.status})`};let i=_e(r.body).data?.find(t=>t.type===`skill`&&t.attributes.name===e);if(!i)return{error:`skill "${e}" not found on Tessl registry`};let a=Mi(i.attributes.sourceUrl);if(!a)return{error:`skill "${e}" has no GitHub source URL`};let o=i.attributes.path.replace(/\/SKILL\.md$/i,``);return{owner:a.owner,repo:a.repo,skillPath:o,skillName:e}}const zh=[{label:`Tessl`,host:new URL(mi).host,fetch:Lh},{label:`browse.sh`,host:new URL(_i).host,fetch:Wm}];function Bh(e){let t=[],n=e.reduce((e,t)=>Math.max(e,t.length),0);for(let r=0;r<n;r++)for(let n of e)r<n.length&&t.push(n[r]);return t}async function Vh(e,t,n=1){let r=await Promise.allSettled(zh.map(n=>n.fetch(e,t))),i=r.map(e=>e.status===`fulfilled`?e.value:[]),a=r.every(e=>e.status===`rejected`),o=Bh(i),s=``;for(let e=0;e<r.length;e++){let t=r[e];if(t.status===`rejected`){let n=zh[e],r=t.reason instanceof Error?t.reason.message:String(t.reason);s+=`warning: ${n.label} registry unavailable (${n.host}): ${r}\n`}}if(o.length===0){let t=a?`${s}upskill: registries failed to respond\n`:s;return{stdout:`No skills found for "${e}"\n\nTry a different search term or browse the registries at https://tessl.io/registry or https://browse.sh\n`,stderr:t,exitCode:+!!a}}let c=o.length,l=Math.ceil(c/10),u=Math.max(1,Math.min(n,l)),d=(u-1)*10,f=o.slice(d,d+10),p=`Search results for "${e}" (page ${u}/${l}, ${c} total):\n\n`;for(let e of f){let t=e.qualityScore==null?` `:String(e.qualityScore).padStart(3),n=`[${e.source}]`,r=e.sourceRepo?` ${e.sourceRepo}`:``;p+=` ${e.name.padEnd(30)} ${t} ${n.padEnd(10)}${r}\n`,e.summary&&(p+=` ${e.summary}\n`),p+=`
|
|
294
294
|
`}return u<l&&(p+=`Showing ${d+1}-${d+f.length} of ${c}. `,p+=`Next page: upskill search ${e} --page ${u+1}\n\n`),p+=`To install:
|
|
295
295
|
`,p+=` From Tessl: upskill <owner/repo> --skill <name>
|
|
296
296
|
`,p+=` From browse.sh: upskill browse:<hostname>/<task>
|
|
@@ -313,7 +313,7 @@ Examples:
|
|
|
313
313
|
`,{stdout:s,stderr:``,exitCode:0}}function Jh(e){return!e||e.startsWith(`-`)?{stdout:``,stderr:`upskill: --branch requires a value
|
|
314
314
|
`,exitCode:1}:i(e)?null:{stdout:``,stderr:`upskill: --branch must be a git ref of [A-Za-z0-9._/-]+ with no "..", leading "-"/"/", trailing "/" or ".lock", or shell metacharacters
|
|
315
315
|
`,exitCode:1}}function Yh(e){let t={selectedSkills:[],listOnly:!1,installAll:!1,force:!1,sourceRef:``},n=0;for(;n<e.length;){let r=e[n];if(r===`--skill`)t.selectedSkills.push(e[++n]);else if(r===`--path`||r===`-p`){let r=e[++n];if(typeof r!=`string`||!o(r))return t.earlyReturn={stdout:``,stderr:`upskill: --path must be a repo-relative sub-path of [A-Za-z0-9._/-]+ with no "..", leading "-"/"/", or shell metacharacters
|
|
316
|
-
`,exitCode:1},t;t.subPath=r}else if(r===`--list`)t.listOnly=!0;else if(r===`--all`)t.installAll=!0;else if(r===`--force`)t.force=!0;else if(r===`--branch`||r===`-b`){let r=Jh(e[n+1]);if(r)return t.earlyReturn=r,t;t.branch=e[++n]}else r.startsWith(`-`)||(t.sourceRef=r);n++}return t}async function Xh(e,t,n){if(!t)return{stdout:``,stderr:`upskill: ${e} requires a skill name\n`,exitCode:1};let r=await import(`./kernel-worker-
|
|
316
|
+
`,exitCode:1},t;t.subPath=r}else if(r===`--list`)t.listOnly=!0;else if(r===`--all`)t.installAll=!0;else if(r===`--force`)t.force=!0;else if(r===`--branch`||r===`-b`){let r=Jh(e[n+1]);if(r)return t.earlyReturn=r,t;t.branch=e[++n]}else r.startsWith(`-`)||(t.sourceRef=r);n++}return t}async function Xh(e,t,n){if(!t)return{stdout:``,stderr:`upskill: ${e} requires a skill name\n`,exitCode:1};let r=await import(`./kernel-worker-iJeImuDy.js`).then(e=>e.r);if(e===`info`){let e=await r.getSkillInfo(n,t);if(!e)return{stdout:``,stderr:`upskill: skill "${t}" not found\n`,exitCode:1};let i=await Ai(n,t),a=i?ji(i):"Installed from: (no provenance recorded — reinstall to enable `upskill update`)\n";return{stdout:rh(e)+a,stderr:``,exitCode:0}}let i=await r.readSkillInstructions(n,t);return i===null?{stdout:``,stderr:`upskill: no SKILL.md found for "${t}"\n`,exitCode:1}:{stdout:i+`
|
|
317
317
|
`,stderr:``,exitCode:0}}async function Zh(e,t,n,r,i,a,o,s){let c=``,l=``,u=0,d=e.length;for(let f=0;f<e.length;f++){let p=e[f],m=await Ii(p.path,p.name,r,i,a,s?{...s,path:p.path}:void 0),h=f+1,g=((Date.now()-o)/1e3).toFixed(1),_=(Date.now()-o)/h,v=h<d?` (~${Math.round((d-h)*_/1e3)}s remaining)`:``;m.ok?(c+=`[${h}/${d}] Installed "${p.name}" from ${t}/${n} (${g}s)${v}\n`,u++):(c+=`[${h}/${d}] Failed "${p.name}": ${m.error}${v}\n`,l+=`upskill: ${m.error}\n`)}return{output:c,errors:l,successCount:u}}async function Qh(e,t,n,r,i,a,o,s){let c=``,l=``,u=0,d=e.length;for(let f=0;f<e.length;f++){let p=e[f],m=await Fi(t,n,p.path,p.name,i,r,a,void 0,o),h=f+1,g=((Date.now()-s)/1e3).toFixed(1),_=(Date.now()-s)/h,v=h<d?` (~${Math.round((d-h)*_/1e3)}s remaining)`:``;m.exitCode===0?(c+=`[${h}/${d}] Installed "${p.name}" from ${t}/${n} (${g}s)${v}\n`,u++):(c+=`[${h}/${d}] Failed "${p.name}": ${m.stderr.trim()}${v}\n`,l+=m.stderr)}return{output:c,errors:l,successCount:u}}async function $h(e,t,n,r,i,a,o,s){let c=``,l=``,u=0;for(let d of e){let e=await Fi(t,n,d.path,d.name,i,r,a,o,s);e.exitCode===0?(c+=e.stdout,u++):l+=e.stderr}return{output:c,errors:l,successCount:u}}function eg(e,t,n){let r=`Available skills in ${t}/${n}:\n\n`;for(let t of e)r+=` ${t.name.padEnd(30)} ${t.path}\n`;return r+=`\nFound ${e.length} skill(s)\n`,r}async function tg(e,t,n,r){let{owner:i,repo:a}=e,o=t.branch??e.branch,s=t.subPath??e.path,c=await Ei(r),l=await Li(i,a,c,s,r,o);if(l.error)return{stdout:``,stderr:`upskill: failed to list skills: ${l.error}\n`,exitCode:1};if(l.skills.length===0)return{stdout:`No skills found in ${i}/${a}${s?`/`+s:``}\n`,stderr:``,exitCode:0};if(t.listOnly)return{stdout:eg(l.skills,i,a)+`\nTo install: upskill ${t.sourceRef} --skill <name>\nTo install all: upskill ${t.sourceRef} --all\n`,stderr:``,exitCode:0};let u=l.skills;if(t.selectedSkills.length>0){u=l.skills.filter(e=>t.selectedSkills.includes(e.name));for(let e of t.selectedSkills)if(!l.skills.find(t=>t.name===e))return{stdout:``,stderr:`upskill: skill "${e}" not found in ${i}/${a}\n`,exitCode:1}}else if(!t.installAll)return{stdout:eg(l.skills,i,a)+`\nTo install specific skills: upskill ${t.sourceRef} --skill <name>\nTo install all: upskill ${t.sourceRef} --all\n`,stderr:``,exitCode:0};let d=u.length,f=Date.now(),p=``,m=``,h=0;if(d>1){let e=await Ci(i,a,r,o);if(e.status===`ok`){let r=await Oi(i,a,o,c,!0,s),l=await Zh(u,i,a,vi(e.files),n,t.force,f,{kind:`github`,source:`${i}/${a}`,ref:o,sha:r});({output:p,errors:m,successCount:h}=l)}else{let e=await Qh(u,i,a,c,n,t.force,o,f);({output:p,errors:m,successCount:h}=e)}}else({output:p,errors:m,successCount:h}=await $h(u,i,a,c,n,t.force,r,o));let g=((Date.now()-f)/1e3).toFixed(1);return h>0&&(p+=`\nInstalled ${h} skill(s)${d>1?` in ${g}s`:``}\n`,await Ni()),{stdout:p,stderr:m,exitCode:+!!m}}async function ng(e,t,n,r,i){switch(e[0]){case`tabs`:return Kh(t,n,r,e.includes(`--json`));case`recommendations`:return qh(t,n,e.includes(`--install`));case`update`:case`upgrade`:return Ah(e.slice(1),t,n);case`list`:return Ih(e.slice(1),t,n,i);case`info`:case`read`:return Xh(e[0],e[1],t);case`search`:return ig(e,n);default:return null}}function rg(e,t,n){return S(`upskill`,async(r,i)=>{if(r.length===0||r.includes(`--help`)||r.includes(`-h`))return ih();let a=await ng(r,e,t,n,i.env.get(`PATH`));if(a)return a;let o=Yh(r);if(o.earlyReturn)return o.earlyReturn;if(!o.sourceRef)return ih();if(o.sourceRef.startsWith(`tessl:`))return ag(o.sourceRef,o.force,e,t);let s=qm(o.sourceRef);if(s)return $m(s.hostname,s.task,e,t,o.force);let c=Pi(o.sourceRef);return c?tg(c,o,e,t):{stdout:``,stderr:`upskill: unrecognized source "${o.sourceRef}"\n\nExpected: owner/repo, tessl:<name>, or browse:<hostname>/<task>\n`,exitCode:1}})}async function ig(e,t){let n=[...e.slice(1)],r=n.indexOf(`--page`),i=1;r>=0&&(i=parseInt(n[r+1],10)||1,n.splice(r,2));let a=n.join(` `);return a?Vh(a,t,i):ih()}async function ag(e,t,n,r){let i=e.slice(6);if(!i)return{stdout:``,stderr:`upskill: tessl: requires a skill name
|
|
318
318
|
`,exitCode:1};let a=await Rh(i,r);if(`error`in a)return{stdout:``,stderr:`upskill: ${a.error}\n`,exitCode:1};let o=await Ei(r);return Fi(a.owner,a.repo,a.skillPath,a.skillName,n,o,t,r)}function og(){return{stdout:`usage: afplay [-v volume] [-r rate] <file>
|
|
319
319
|
|
|
@@ -707,7 +707,7 @@ Examples:
|
|
|
707
707
|
`;for(let n of e)t+=` ${n.id} ${n.name.padEnd(20)} ${n.cron.padEnd(15)}`,n.scoop&&(t+=` -> ${n.scoop}`),n.filter&&(t+=` [filtered]`),t+=` (${n.status})`,n.nextRun&&(t+=` next: ${new Date(n.nextRun).toLocaleString()}`),t+=`
|
|
708
708
|
`;return t}async function gy(e,t){let n=C(e.slice(1),{});if(`error`in n)return py(n.error);if(!t()){let e=await oy();if(!e)return ly(`list`);let t=await e.listCronTasks();return t.length===0?{stdout:`No active cron tasks
|
|
709
709
|
`,stderr:``,exitCode:0}:{stdout:hy(t),stderr:``,exitCode:0}}let{ok:r,data:i}=await dy(`GET`,``);if(!r)return{stdout:``,stderr:`crontask: failed to list: ${i.error??`unknown error`}\n`,exitCode:1};let a=i;return a.length===0?{stdout:`No active cron tasks
|
|
710
|
-
`,stderr:``,exitCode:0}:{stdout:hy(a),stderr:``,exitCode:0}}async function _y(e,t){let n=e[0],r=C(e.slice(1),{});if(`error`in r)return py(r.error);let i=r.positionals[0];if(!i)return{stdout:``,stderr:`crontask: ${n} requires an ID\n`,exitCode:1};if(!t()){let e=await oy();return e?await e.deleteCronTask(i)?{stdout:`Deleted cron task "${i}"\n`,stderr:``,exitCode:0}:{stdout:``,stderr:`crontask: task "${i}" not found\n`,exitCode:1}:ly(`delete`)}let{ok:a,status:o,data:s}=await dy(`DELETE`,`/${i}`);return a?{stdout:`Deleted cron task "${i}"\n`,stderr:``,exitCode:0}:o===404?{stdout:``,stderr:`crontask: task "${i}" not found\n`,exitCode:1}:{stdout:``,stderr:`crontask: failed to delete: ${s.error??`unknown error`}\n`,exitCode:1}}function vy(e={}){let t=e.hasLocalNodeServer??(()=>!1);return S(`crontask`,async(e,n)=>{let r=e[0];if(!r||w(e,{valueFlags:fy}))return uy();try{switch(r){case`create`:return await my(e,n.env,t);case`list`:return await gy(e,t);case`delete`:case`kill`:return await _y(e,t);default:return{stdout:``,stderr:`crontask: unknown command "${r}"\n`,exitCode:1}}}catch(e){return{stdout:``,stderr:`crontask: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}})}function yy(e){return S(`curlwright`,async(t,n)=>{let{runCurlwright:r}=await import(`./run-
|
|
710
|
+
`,stderr:``,exitCode:0}:{stdout:hy(a),stderr:``,exitCode:0}}async function _y(e,t){let n=e[0],r=C(e.slice(1),{});if(`error`in r)return py(r.error);let i=r.positionals[0];if(!i)return{stdout:``,stderr:`crontask: ${n} requires an ID\n`,exitCode:1};if(!t()){let e=await oy();return e?await e.deleteCronTask(i)?{stdout:`Deleted cron task "${i}"\n`,stderr:``,exitCode:0}:{stdout:``,stderr:`crontask: task "${i}" not found\n`,exitCode:1}:ly(`delete`)}let{ok:a,status:o,data:s}=await dy(`DELETE`,`/${i}`);return a?{stdout:`Deleted cron task "${i}"\n`,stderr:``,exitCode:0}:o===404?{stdout:``,stderr:`crontask: task "${i}" not found\n`,exitCode:1}:{stdout:``,stderr:`crontask: failed to delete: ${s.error??`unknown error`}\n`,exitCode:1}}function vy(e={}){let t=e.hasLocalNodeServer??(()=>!1);return S(`crontask`,async(e,n)=>{let r=e[0];if(!r||w(e,{valueFlags:fy}))return uy();try{switch(r){case`create`:return await my(e,n.env,t);case`list`:return await gy(e,t);case`delete`:case`kill`:return await _y(e,t);default:return{stdout:``,stderr:`crontask: unknown command "${r}"\n`,exitCode:1}}}catch(e){return{stdout:``,stderr:`crontask: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}})}function yy(e){return S(`curlwright`,async(t,n)=>{let{runCurlwright:r}=await import(`./run-DBtyhE88.js`);return r(e,t,n)})}function by(e,t={}){if(!Number.isFinite(e)||e<0)return``;if(t.si){if(e<1e3)return`${Math.round(e)} B`;let t=[`kB`,`MB`,`GB`,`TB`],n=e/1e3,r=0;for(;n>=1e3&&r<t.length-1;)n/=1e3,r+=1;return`${n<10?n.toFixed(1):Math.round(n)} ${t[r]}`}if(e<1024)return Number.isInteger(e)?`${e} B`:e>=.1?`${e.toFixed(1)} B`:e>0?`${Math.max(.01,Number(e.toFixed(2)))} B`:`0 B`;let n=[`KB`,`MB`,`GB`,`TB`,`PB`],r=e,i=-1;for(;r>=1024&&i<n.length-1;)r/=1024,i+=1;return`${r.toFixed(1)} ${n[i]}`}function xy(e){return by(e,{si:!1})}const Sy=`slicc-fs`;async function Cy(){try{let e=globalThis.indexedDB;if(!e)return!1;let t=e.databases;return typeof t!=`function`||(await t.call(e)).some(e=>e.name===Sy)}catch{return!0}}async function wy(){let e=globalThis.indexedDB;return e?new Promise(t=>{let n;try{n=e.deleteDatabase(Sy)}catch{t(`error`);return}n.onsuccess=()=>t(`deleted`),n.onerror=()=>t(`error`),n.onblocked=()=>t(`blocked`)}):`error`}async function Ty(){if(!await Cy())return{kind:`absent`,message:`legacy slicc-fs IDB not present — nothing to clean`};let e=await wy();return e===`deleted`?{kind:`deleted`,message:`legacy slicc-fs IDB deleted`}:e===`blocked`?{kind:`blocked`,message:`legacy slicc-fs IDB delete blocked by another connection — close other tabs and retry`}:{kind:`error`,message:`legacy slicc-fs IDB delete failed`}}function Ey(){return`slicc-fs-cleanup — delete the legacy slicc-fs IndexedDB
|
|
711
711
|
|
|
712
712
|
Usage:
|
|
713
713
|
slicc-fs-cleanup Delete the legacy slicc-fs IDB.
|
|
@@ -924,7 +924,7 @@ Options:
|
|
|
924
924
|
--pattern <glob> File pattern to match, e.g. "*.md", "*.bsh" (required)
|
|
925
925
|
--scoop <target> Scoop name, cone name, or folder. Omit for your own cone.
|
|
926
926
|
--name <name> Human-readable name for the watcher
|
|
927
|
-
`);switch(n){case`list`:return MS(e);case`delete`:return NS(e);case`create`:return await IS(e,t.env);default:return AS(`unknown command: ${n}`)}})}function RS(e){return S(`gelatiere`,async(t,n)=>{let{runGelatiere:r}=await import(`./run-
|
|
927
|
+
`);switch(n){case`list`:return MS(e);case`delete`:return NS(e);case`create`:return await IS(e,t.env);default:return AS(`unknown command: ${n}`)}})}function RS(e){return S(`gelatiere`,async(t,n)=>{let{runGelatiere:r}=await import(`./run-B_h9dk2T.js`);return r(t,n,e)})}function zS(e){return typeof e.stdoutIsTTY!=`boolean`||e.stdoutIsTTY}function BS(e,t){return typeof e.stdinIsTTY==`boolean`?e.stdinIsTTY:t===void 0?si(e.stdin).length===0:t===0}function VS(){return{stdout:`usage: hear [-i file] [-l lang] [-T seconds] [-d deviceId] [--engine name]
|
|
928
928
|
hear --devices | --status | --warmup
|
|
929
929
|
|
|
930
930
|
Speech recognition: listens on the microphone until you pause, then
|
|
@@ -1209,7 +1209,7 @@ Options:
|
|
|
1209
1209
|
`,stderr:``,exitCode:0}}let a=e.routes.get(r.targetId)??[],o=a.length,s=a.filter(e=>e.pattern!==i);if(e.routes.set(r.targetId,s),s.length===0){let t=e.routeCleanup.get(r.targetId);t&&(t(),e.routeCleanup.delete(r.targetId))}return{stdout:`Removed ${o-s.length} route(s) matching "${i}"\n`,stderr:``,exitCode:0}},pT=`/.playwright`;function mT(e,t){return e?`${t.replace(/\/+$/,``)}${pT}`:pT}async function hT(e,t,n){if(!t.sessionDirsCreated.has(n)){for(let t of[n,`${n}/snapshots`,`${n}/screenshots`])try{await e.mkdir(t,{recursive:!0})}catch(e){if(!jn(e))throw e}t.sessionDirsCreated.add(n)}}async function gT(e,t,n,r,i){try{return await e.withTab(n,async e=>{let{url:a,title:o,text:s,refToSelector:c,refToBackendNodeId:l,refToFrameId:u}=await se(e),d={url:a,title:o,refToSelector:c,refToBackendNodeId:l,refToFrameId:u,content:s,timestamp:Date.now()};r.snapshots.set(n,d);let f=[`Page URL: ${a}`,`Page Title: ${o}`,``,s].join(`
|
|
1210
1210
|
`),p=`${i}/snapshots/page-${kn(new Date)}.yml`;return await t.writeFile(p,f),p})}catch{return null}}async function _T(e,t,n,r){await hT(e,t,n);let i=new Date().toISOString(),a=`playwright-cli ${r.command}${r.args.length?` `+r.args.join(` `):``}`,o=r.result.exitCode===0?r.result.stdout.trim()||`OK`:`Error: ${r.result.stderr.trim()}`,s=[`### ${a}`,`- **Time**: ${i}`];if(r.tabUrl||r.targetId){let e=r.tabUrl?`${r.tabUrl}${r.targetId?` (targetId: ${r.targetId})`:``}`:`targetId: ${r.targetId}`;s.push(`- **Tab**: ${e}`)}s.push(`- **Result**: ${o}`),r.snapshotPath&&s.push(``,`[Snapshot](${r.snapshotPath})`),s.push(`---`,``);let c=s.join(`
|
|
1211
1211
|
`)+`
|
|
1212
|
-
`,l=`${n}/session.md`,u=``;try{let t=await e.readFile(l);u=typeof t==`string`?t:new TextDecoder().decode(t)}catch{}await e.writeFile(l,u+c)}function vT(){return import(`./snapshot-features-
|
|
1212
|
+
`,l=`${n}/session.md`,u=``;try{let t=await e.readFile(l);u=typeof t==`string`?t:new TextDecoder().decode(t)}catch{}await e.writeFile(l,u+c)}function vT(){return import(`./snapshot-features-CTe9oU5o.js`)}async function yT(e,t,n,r){let i=await e.getAccessibilityTreeForFrame(r.frameId),a=new Map,o=new Map,s=new Map,c=oe(i,a,o,{value:0},``,`f1`);for(let e of a.keys())s.set(e,r.frameId);let l=c.join(`
|
|
1213
1213
|
`);return t.snapshots.set(n,{url:r.url,title:r.name,refToSelector:a,refToBackendNodeId:o,refToFrameId:s,content:l,timestamp:Date.now()}),l}async function bT(e,t){await e.send(`DOM.enable`),await e.send(`Runtime.enable`);let n=(await e.send(`DOM.resolveNode`,{backendNodeId:t})).object;if(n?.objectId)return(await e.send(`Runtime.callFunctionOn`,{objectId:n.objectId,functionDeclaration:`function() {
|
|
1214
1214
|
this.scrollIntoView({ block: 'center' });
|
|
1215
1215
|
const r = this.getBoundingClientRect();
|
|
@@ -1287,7 +1287,7 @@ Options:
|
|
|
1287
1287
|
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
1288
1288
|
return el.files.length;
|
|
1289
1289
|
})()`,r=await t.send(`Runtime.evaluate`,{expression:n,returnByValue:!0,awaitPromise:!1},e);if(r.exceptionDetails){let e=r.exceptionDetails.exception?.description??r.exceptionDetails.text??`File upload failed`;throw Error(e)}});let p=d.map(e=>e.split(`/`).pop()??e).join(`, `);return{stdout:`Uploaded ${d.length} file(s): ${p}\n`,stderr:``,exitCode:0}}],[`state-save`,jT],[`state-load`,MT],[`console`,lC],[`requests`,Zw],[`request`,Qw],[`request-headers`,$w],[`request-body`,eT],[`response-headers`,tT],[`response-body`,nT],[`mousemove`,tw],[`mousedown`,nw],[`mouseup`,rw],[`mousewheel`,iw],[`drop`,aw],[`route`,uT],[`route-list`,dT],[`unroute`,fT],[`generate-locator`,yC],[`highlight`,bC]]);function tE(){let e=(Pn.string??[]).map(e=>`--${e}`),t=new Set(Pn.boolean??[]);for(let[e,n]of Object.entries(Pn.alias??{})){let r=[e,...Array.isArray(n)?n:[n]];if(r.some(e=>t.has(e)))for(let e of r)t.add(e)}return{value:e,bool:[...[...t].map(e=>`--${e}`),`--help`,`-h`,`--no-iframes`]}}function nE(e){return e.map(e=>e===`--no-iframes`||e.startsWith(`--no-iframes=`)?e.replace(`--no-iframes`,`--_noiframes`):e)}function rE(e){return{...e,bool:[...e.bool??[],`--_noiframes`],value:[...e.value??[],`--_noiframes`]}}const iE=2e3;function aE(e,t){if(typeof e.getTabLockStats!=`function`)return;let n=e.getTabLockStats();return t?{totalWaitMs:n.totalWaitMs,tabWaitMs:e.getTabLockStats(t).tabWaitMs}:{totalWaitMs:n.totalWaitMs}}function oE(e,t,n,r){if(!t||typeof e.getTabLockStats!=`function`)return r;let i=e.getTabLockStats(),a=i.totalWaitMs-t.totalWaitMs;if(a<iE)return r;let o=(a/1e3).toFixed(1),s=n&&t.tabWaitMs!==void 0?e.getTabLockStats(n).tabWaitMs-t.tabWaitMs:0,c=`note: browser bridge contended — lock waits totaled ${o}s while this command ran, ${s>=iE?`${(s/1e3).toFixed(1)}s of it waiting on this tab (--tab=${n})`:`all of it waiting on the bridge, not on this tab`} (queue depth ${i.queueDepth}). Commands on the same tab serialize; commands on different tabs run in parallel — stagger callers on THIS tab, or give each caller its own tab.
|
|
1290
|
-
`;return{...r,stderr:r.stderr+c}}async function sE(e,t,n){let r=n instanceof Error?n.message:String(n);return{stdout:``,stderr:`Error: ${(t.tab?await Fn(e,t.tab,n):null)??r}\n`,exitCode:1}}function cE(e,t,n){return{stdout:``,stderr:`${e} ${t}: ${n===void 0?`aborted: the caller stopped waiting for it`:n instanceof Error?n.message:String(n)}\n`,exitCode:130}}async function lE(e,t,n){let r=eE.get(t);if(!r)return{stdout:``,stderr:`Unknown command: ${t}\nRun "playwright-cli help" for usage.\n`,exitCode:1};let{signal:i}=n;try{let a=await r(n);return i?.aborted?cE(e,t,void 0):a}catch(r){return i?.aborted?cE(e,t,r):await sE(n.browser,n.flags,r)}}async function uE(e,t,n,r){let i=C(nE(n),rE(r));if(`error`in i)return{answer:{stdout:``,stderr:`${e} ${t}: ${i.error}\n`,exitCode:1}};let a;try{({flags:a}=Nn(n))}catch(n){return{answer:{stdout:``,stderr:`${e} ${t}: ${n instanceof Error?n.message:String(n)}\n`,exitCode:1}}}if(a.help===`true`||a.h===`true`){let{formatSubcommandHelp:n}=await import(`./help-
|
|
1290
|
+
`;return{...r,stderr:r.stderr+c}}async function sE(e,t,n){let r=n instanceof Error?n.message:String(n);return{stdout:``,stderr:`Error: ${(t.tab?await Fn(e,t.tab,n):null)??r}\n`,exitCode:1}}function cE(e,t,n){return{stdout:``,stderr:`${e} ${t}: ${n===void 0?`aborted: the caller stopped waiting for it`:n instanceof Error?n.message:String(n)}\n`,exitCode:130}}async function lE(e,t,n){let r=eE.get(t);if(!r)return{stdout:``,stderr:`Unknown command: ${t}\nRun "playwright-cli help" for usage.\n`,exitCode:1};let{signal:i}=n;try{let a=await r(n);return i?.aborted?cE(e,t,void 0):a}catch(r){return i?.aborted?cE(e,t,r):await sE(n.browser,n.flags,r)}}async function uE(e,t,n,r){let i=C(nE(n),rE(r));if(`error`in i)return{answer:{stdout:``,stderr:`${e} ${t}: ${i.error}\n`,exitCode:1}};let a;try{({flags:a}=Nn(n))}catch(n){return{answer:{stdout:``,stderr:`${e} ${t}: ${n instanceof Error?n.message:String(n)}\n`,exitCode:1}}}if(a.help===`true`||a.h===`true`){let{formatSubcommandHelp:n}=await import(`./help-CPJ8dRbw.js`);return{answer:{stdout:n(e,t),stderr:``,exitCode:0}}}let o=null;try{let{validateSubcommandArgs:r}=await import(`./validate-args-BcxRh84E.js`);o=r(e,t,n,i.positionals)}catch{o=null}return o?{answer:{stdout:``,stderr:o,exitCode:1}}:{positional:i.positionals,flags:a}}function dE(e,t,n,r={}){let i=t?An(t,n):null,a=tE();return S(e,async(o,s)=>{if(o.length===0||o[0]===`help`||o[0]===`--help`||o[0]===`-h`){let{formatHelp:t}=await import(`./help-CPJ8dRbw.js`);return{stdout:t(e)+`
|
|
1291
1291
|
`,stderr:``,exitCode:0}}let c=o[0],l=o.slice(1),u=await uE(e,c,l,a);if(`answer`in u)return u.answer;let{positional:d,flags:f}=u;if(!t||!i)return{stdout:``,stderr:`${e}: browser APIs are unavailable in this environment\n`,exitCode:1};let p=f.tab??null,m=aE(t,p),h=Ki(s.env),g=mT(r.isScoop?.()??!1,h),_=await lE(e,c,{browser:t,fs:n,state:i,positional:d,flags:f,scratchDir:h,sessionRoot:g,onTab:(e,n)=>t.withTab(e,n,{signal:s.signal}),signal:s.signal}),v=f.tab??null,ee=null;Vn.has(c)&&_.exitCode===0&&v&&(ee=await gT(t,n,v,i,g));try{await _T(n,i,g,{command:c,args:l,result:_,snapshotPath:ee,targetId:v})}catch{}return oE(t,m,p,_)})}const fE=new Map([[`File operations`,[`ls`,`cat`,`head`,`tail`,`wc`,`touch`,`mkdir`,`rm`,`cp`,`mv`,`ln`,`chmod`,`stat`,`readlink`,`file`,`rmdir`,`rsync`]],[`Text processing`,[`grep`,`sed`,`awk`,`sort`,`uniq`,`cut`,`tr`,`tee`,`diff`,`patch`,`column`,`comm`,`egrep`,`fgrep`,`expand`,`unexpand`,`fold`,`join`,`nl`,`od`,`paste`,`rev`,`split`,`strings`,`tac`]],[`Search`,[`find`,`rg`]],[`Navigation & paths`,[`pwd`,`basename`,`dirname`,`tree`,`du`,`cd`]],[`Archives`,[`zip`,`unzip`,`pdftk`,`pdf`,`gunzip`,`gzip`,`zcat`]],[`Media`,[`convert`,`magick`,`pdftoppm`,`pdftocairo`,`pdftotext`,`ffmpeg`,`ffprobe`,`screencapture`]],[`Audio`,[`say`,`hear`,`afplay`,`chime`]],[`Environment & shell`,`echo.printf.env.printenv.export.alias.unalias.history.clear.true.false.bash.sh.commands.which.uname.man.host.oauth-token.secret.nuke.models.local-llm.cost.hostname.whoami.id.help.sleep.time.timeout.oauth-domain`.split(`.`)],[`Data processing`,[`xargs`,`jq`,`base64`,`date`,`expr`,`seq`]],[`Hashes`,[`md5sum`,`sha1sum`,`sha256sum`]],[`Network`,[`curl`,`curlwright`,`wget`,`dig`,`websocat`,`html-to-markdown`]],[`Version control`,[`git`]],[`Languages`,[`node`,`jsh`,`python`,`python3`,`sqlite3`]],[`Virtualization`,[`v86`,`computer`]],[`Build tools`,[`tsc`,`tst`,`esbuild`,`biome`]],[`Packages`,[`ipk`,`hf`,`npm`,`i`,`ipx`,`npx`]],[`Skills`,[`skill`,`upskill`]],[`Browser & UI`,[`serve`,`open`,`imgcat`,...zn,`sprinkle`]],[`Clipboard`,[`pbcopy`,`pbpaste`,`xclip`,`xsel`]],[`Filesystem`,[`mount`,`umount`,`fswatch`]],[`Scoops & agents`,[`agent`,`gelatiere`,`mcp`,`webhook`,`crontask`]],[`Process`,[`ps`,`kill`,`jshd`,`meminfo`,`uptime`]],[`Shell builtins (limited)`,[...Gg]]]);function pE(e,t=[],n=[]){let r=[],i=new Set(e);for(let e of t)i.delete(e);for(let e of n)i.delete(e);r.push(`Available commands:
|
|
1292
1292
|
`);let a=[];for(let[e,t]of fE){let n=t.filter(e=>i.has(e));if(n.length>0){r.push(` ${e}:`),r.push(` ${n.join(`, `)}\n`);for(let e of n)i.delete(e)}}for(let e of i)a.push(e);return a.length>0&&(r.push(` Other:`),r.push(` ${a.sort().join(`, `)}\n`)),t.length>0&&(r.push(` User scripts (.jsh):`),r.push(` ${t.sort().join(`, `)}\n`)),n.length>0&&(r.push(` Workflows:`),r.push(` ${n.sort().join(`, `)}\n`)),r.push(`Use '<command> --help' for details on a specific command.`),r.join(`
|
|
1293
1293
|
`)+`
|
|
@@ -1467,7 +1467,7 @@ manifest without rewriting it. With -g, packages go to /shared/lib/node_modules
|
|
|
1467
1467
|
and deps are recorded in /shared/lib/package.json. Existing fields are
|
|
1468
1468
|
preserved. Idempotent: re-installing an already-satisfied package is a clean
|
|
1469
1469
|
no-op.
|
|
1470
|
-
`}function rO(e){let t=C(e,{bool:tO,value:[`--location`]});if(`error`in t)return t;let n=t.values.get(`--location`);return n!==void 0&&n!==`global`?{error:`unknown flag: --location=${n}`}:{global:t.bools.has(`-g`)||t.bools.has(`--global`)||n===`global`,saveDev:t.bools.has(`-D`)||t.bools.has(`--save-dev`),specs:t.positionals}}function iO(e){let t=!1,n=[];for(let r of e){if(eO.has(r)){t=!0;continue}r.startsWith(`-`)||n.push(r)}return{global:t,specs:n}}function aO(e){return w(e)}function oO(e){return e instanceof Error?e.message:String(e)}async function sO(e){e.scriptCatalog?.invalidateJsh(),await e.syncScriptCommands?.()}function cO(e,t){let n=e===`i`;return S(e,async(r,i)=>{if(n)return aO(r)?{stdout:nO(e),stderr:``,exitCode:0}:uO(e,r,i,t);if(r[0]===`mamba`){let{runIpkMamba:n}=await import(`./ipk-mamba-
|
|
1470
|
+
`}function rO(e){let t=C(e,{bool:tO,value:[`--location`]});if(`error`in t)return t;let n=t.values.get(`--location`);return n!==void 0&&n!==`global`?{error:`unknown flag: --location=${n}`}:{global:t.bools.has(`-g`)||t.bools.has(`--global`)||n===`global`,saveDev:t.bools.has(`-D`)||t.bools.has(`--save-dev`),specs:t.positionals}}function iO(e){let t=!1,n=[];for(let r of e){if(eO.has(r)){t=!0;continue}r.startsWith(`-`)||n.push(r)}return{global:t,specs:n}}function aO(e){return w(e)}function oO(e){return e instanceof Error?e.message:String(e)}async function sO(e){e.scriptCatalog?.invalidateJsh(),await e.syncScriptCommands?.()}function cO(e,t){let n=e===`i`;return S(e,async(r,i)=>{if(n)return aO(r)?{stdout:nO(e),stderr:``,exitCode:0}:uO(e,r,i,t);if(r[0]===`mamba`){let{runIpkMamba:n}=await import(`./ipk-mamba-B0FFCDpT.js`);return n(e,r.slice(1),i,t)}if(aO(r))return{stdout:nO(e),stderr:``,exitCode:0};if(r.length===0)return{stdout:nO(e),stderr:`${e}: missing subcommand\n`,exitCode:1};let a=r[0],o=r.slice(1);return ZD.has(a)?uO(e,o,i,t):QD.has(a)?fO(e,o,i,t):$D.has(a)?pO(e,o,i,t):a===`root`?mO(e,o,i,t):bD.has(a)?XD(e,o,i,{fs:t.fs}):xD.has(a)?XD(e,r,i,{fs:t.fs}):{stdout:``,stderr:`${e}: unknown subcommand '${a}' (supported: install, uninstall, list, root, run, mamba)\n`,exitCode:1}})}async function lO(e,t,n){let r;try{r=await Zi({fs:n.fs,fetch:n.fetch,cwd:t.cwd})}catch(t){return t instanceof ea?{stdout:``,stderr:`${e}: ${t.message}\n`,exitCode:1}:{stdout:``,stderr:`${e}: install failed: ${oO(t)}\n`,exitCode:1}}if(r.empty&&r.errors.length===0)return{stdout:`${e}: nothing to install (package.json declares no dependencies)\n`,stderr:``,exitCode:0};let i=r.results.map(t=>`${e}: installed ${t.name}@${t.version} -> ${t.installPath}`),a=r.errors.map(t=>`${e}: failed to install ${t.spec}: ${oO(t.error)}`);return{stdout:i.length>0?`${i.join(`
|
|
1471
1471
|
`)}\n`:``,stderr:a.length>0?`${a.join(`
|
|
1472
1472
|
`)}\n`:``,exitCode:r.errors.length===0?0:1}}async function uO(e,t,n,r){let i=rO(t);if(`error`in i)return{stdout:``,stderr:`${e}: ${i.error}\n`,exitCode:1};let{global:a,saveDev:o,specs:s}=i;if(a&&s.length===0)return{stdout:``,stderr:`${e}: global install requires at least one package name\n`,exitCode:1};if(s.length===0)return lO(e,n,r);let c;try{c=await $i(s,{fs:r.fs,fetch:r.fetch,cwd:n.cwd,global:a,saveDev:o})}catch(t){return{stdout:``,stderr:`${e}: install failed: ${oO(t)}\n`,exitCode:1}}let l=c.results.map(t=>`${e}: installed ${t.name}@${t.version} -> ${t.installPath}`),u=c.errors.map(t=>`${e}: failed to install ${t.spec}: ${oO(t.error)}`);return a&&c.results.length>0&&await sO(r),{stdout:l.length>0?`${l.join(`
|
|
1473
1473
|
`)}\n`:``,stderr:u.length>0?`${u.join(`
|
|
@@ -1489,7 +1489,7 @@ Options:
|
|
|
1489
1489
|
--global Resolve only from the shared global prefix (/shared/lib/node_modules)
|
|
1490
1490
|
-h, --help Show this help message
|
|
1491
1491
|
`}async function IO(e,t){let n=await e.readFile(t);return typeof n==`string`?n:new TextDecoder().decode(n)}async function LO(e,t){try{return(await e.stat(t)).type===`file`}catch{return!1}}async function RO(e,t){try{return(await e.stat(t)).type===`directory`}catch{return!1}}function*zO(e,t=!1){if(t){yield $n;return}let n=b(e);for(;yield x(n,`node_modules`),n!==`/`;)n=Me(n).dir;yield $n}async function BO(e,t,n,r=!1){for(let i of zO(t,r)){let t=x(i,`.bin`,n);if(!await LO(e,t))continue;let r=await IO(e,t),a=PO.exec(r),o=Me(t).dir;return{binFilePath:a?x(o,a[1]):t,argvName:t}}return null}function VO(e){if(e.startsWith(`@`)){let t=e.indexOf(`/`);if(t!==-1)return e.slice(t+1)}return e}function HO(e,t){if(typeof e==`string`)return{binName:VO(t),binPath:e};if(typeof e!=`object`||!e)return null;let n=[t,VO(t)];for(let t of n){let n=Object.getOwnPropertyDescriptor(e,t)?.value;if(typeof n==`string`)return{binName:t,binPath:n}}let r=Object.entries(e).filter(e=>typeof e[1]==`string`);if(r.length===1){let[e,t]=r[0];return{binName:e,binPath:t}}return null}async function UO(e,t,n,r=!1){for(let i of zO(t,r)){let t=x(i,n),r=x(t,`package.json`);if(!await LO(e,r))continue;let a;try{a=JSON.parse(await IO(e,r))}catch{return null}let o=HO(a.bin,n);if(!o)return null;let s=o.binPath.replace(/^\.\//,``);return{binFilePath:x(t,s),argvName:x(i,`.bin`,o.binName)}}return null}async function WO(e,t,n,r=!1){return await BO(e,t,n,r)??await UO(e,t,n,r)}async function GO(e,t,n){for(let r of zO(t))if(await LO(e,x(r,n,`package.json`)))return!0;return!1}function KO(e){return e instanceof Error?e.message:String(e)}function qO(e,t){return{stdout:``,stderr:`${e}: ${t}\n`,exitCode:1}}async function JO(e,t,n,r){try{let i=await $i([t],{fs:r.fs,fetch:r.fetch,cwd:n.cwd});if(i.errors.length>0)return{error:qO(e,`failed to install '${t}': ${KO(i.errors[0].error)}`)};let a=i.results.map(t=>`${e}: installed ${t.name}@${t.version}`);return{progress:a.length>0?`${a.join(`
|
|
1492
|
-
`)}\n`:``}}catch(n){return{error:qO(e,`failed to install '${t}': ${KO(n)}`)}}}async function YO(e,t,n,r){return await LO(r,n)?null:await RO(r,n)?qO(e,`bin target '${n}' is a directory, not a file`):qO(e,`bin file '${n}' for '${t}' does not exist`)}async function XO(e,t,n,r,i,a){if(await GO(a.fs,i.cwd,t))return{error:qO(e,`package '${t}' does not expose an executable bin`)};let o=r?void 0:jO(t);if(o)return{error:{stdout:``,stderr:NO(e,t,n,o),exitCode:1}};let s=await JO(e,t,i,a);if(`error`in s)return s;let c=await WO(a.fs,i.cwd,t);return c?{resolved:c,installProgress:s.progress}:{error:qO(e,`package '${t}' was installed but does not expose an executable bin`)}}function ZO(e,t){return{name:e,trusted:!0,async execute(n,r){if(n.length===0||n[0]===`--help`||n[0]===`-h`)return{stdout:FO(e),stderr:``,exitCode:+(n.length===0)};let i=n[0]===`--force`,a=i?n.slice(1):n,o=a[0]===`--global`;o&&(a=a.slice(1));let s=a;if(s.length===0)return{stdout:FO(e),stderr:``,exitCode:1};let c=s[0],l=s.slice(1),u;try{u=await WO(t.fs,r.cwd,c,o)}catch(t){return qO(e,KO(t))}let d=``;if(!u){if(o)return qO(e,`no global bin '${c}' found in ${$n}`);let n=await XO(e,c,l,i,r,t);if(`error`in n)return n.error;u=n.resolved,d=n.installProgress}let f=await YO(e,c,u.binFilePath,t.fs);if(f)return f;let p=Zr(await IO(t.fs,u.binFilePath)),m=[`node`,u.argvName,...l],h=await Yr(p,m,r,void 0,{filename:u.binFilePath});return{stdout:h.stdout,stderr:d+h.stderr,exitCode:h.exitCode}}}}function QO(e={}){return S(`jshd`,async(t,n)=>{let{runJshd:r}=await import(`./run-
|
|
1492
|
+
`)}\n`:``}}catch(n){return{error:qO(e,`failed to install '${t}': ${KO(n)}`)}}}async function YO(e,t,n,r){return await LO(r,n)?null:await RO(r,n)?qO(e,`bin target '${n}' is a directory, not a file`):qO(e,`bin file '${n}' for '${t}' does not exist`)}async function XO(e,t,n,r,i,a){if(await GO(a.fs,i.cwd,t))return{error:qO(e,`package '${t}' does not expose an executable bin`)};let o=r?void 0:jO(t);if(o)return{error:{stdout:``,stderr:NO(e,t,n,o),exitCode:1}};let s=await JO(e,t,i,a);if(`error`in s)return s;let c=await WO(a.fs,i.cwd,t);return c?{resolved:c,installProgress:s.progress}:{error:qO(e,`package '${t}' was installed but does not expose an executable bin`)}}function ZO(e,t){return{name:e,trusted:!0,async execute(n,r){if(n.length===0||n[0]===`--help`||n[0]===`-h`)return{stdout:FO(e),stderr:``,exitCode:+(n.length===0)};let i=n[0]===`--force`,a=i?n.slice(1):n,o=a[0]===`--global`;o&&(a=a.slice(1));let s=a;if(s.length===0)return{stdout:FO(e),stderr:``,exitCode:1};let c=s[0],l=s.slice(1),u;try{u=await WO(t.fs,r.cwd,c,o)}catch(t){return qO(e,KO(t))}let d=``;if(!u){if(o)return qO(e,`no global bin '${c}' found in ${$n}`);let n=await XO(e,c,l,i,r,t);if(`error`in n)return n.error;u=n.resolved,d=n.installProgress}let f=await YO(e,c,u.binFilePath,t.fs);if(f)return f;let p=Zr(await IO(t.fs,u.binFilePath)),m=[`node`,u.argvName,...l],h=await Yr(p,m,r,void 0,{filename:u.binFilePath});return{stdout:h.stdout,stderr:d+h.stderr,exitCode:h.exitCode}}}}function QO(e={}){return S(`jshd`,async(t,n)=>{let{runJshd:r}=await import(`./run-B-jRxYNq.js`);return r(t,n,e)})}const $O=new Set([`SIGINT`,`SIGTERM`,`SIGKILL`,`SIGSTOP`,`SIGCONT`]);function ek(e={}){return S(`kill`,async t=>{if(t.length===0||t.includes(`--help`)||t.includes(`-h`))return ok();let n=e.processManager??tk();if(!n)return{stdout:``,stderr:`kill: no process manager available in this runtime
|
|
1493
1493
|
`,exitCode:1};let r=nk(t);if(!r.ok)return{stdout:``,stderr:r.stderr,exitCode:r.exitCode};let{allDelivered:i,errors:a}=rk(n,r.pids,r.signal);return{stdout:``,stderr:a.length?`${a.join(`
|
|
1494
1494
|
`)}\n`:``,exitCode:+!i}})}function tk(){let e=globalThis.__slicc_pm;return e instanceof Object&&typeof e.signal==`function`?e:null}function nk(e){let t=`SIGTERM`,n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`-s`||i===`--signal`){let n=e[++r];if(!n)return{ok:!1,stderr:`kill: -s requires a signal name
|
|
1495
1495
|
`,exitCode:2};let i=ik(n);if(i instanceof Error)return{ok:!1,stderr:`kill: ${i.message}\n`,exitCode:2};t=i;continue}if(i.startsWith(`-`)){let e=ak(i);if(e instanceof Error)return{ok:!1,stderr:`kill: ${e.message}\n`,exitCode:2};t=e;continue}let a=Number.parseInt(i,10);if(!Number.isFinite(a)||String(a)!==i)return{ok:!1,stderr:`kill: invalid pid '${i}'\n`,exitCode:2};n.push(a)}return n.length===0?{ok:!1,stderr:`kill: no pids supplied
|
|
@@ -1562,7 +1562,7 @@ Common base URLs:
|
|
|
1562
1562
|
`)+`
|
|
1563
1563
|
`,stderr:``,exitCode:0}}function Nk(e,t){let n=t.models.length;return{stdout:[`✓ ${e} (${kk(t.runtime,!1)})`,` Saved ${n} model${n===1?``:`s`} to Settings:`,...Ak(t.models)].join(`
|
|
1564
1564
|
`)+`
|
|
1565
|
-
`,stderr:``,exitCode:0}}function Pk(){return S(Dk,async e=>{if(e.includes(`--help`)||e.includes(`-h`))return{stdout:Ok(),stderr:``,exitCode:0};let{getApiKeyForProvider:t,getRawApiKeyForProvider:n,getBaseUrlForProvider:r,addAccount:i}=await import(`./account-store-
|
|
1565
|
+
`,stderr:``,exitCode:0}}function Pk(){return S(Dk,async e=>{if(e.includes(`--help`)||e.includes(`-h`))return{stdout:Ok(),stderr:``,exitCode:0};let{getApiKeyForProvider:t,getRawApiKeyForProvider:n,getBaseUrlForProvider:r,addAccount:i}=await import(`./account-store-BQYiWjX3.js`).then(e=>e.t),{verifyConnection:a}=await import(`./local-llm-DFZMKK35.js`).then(e=>e.n),o=e[0]??`status`;if(o!==`status`&&o!==`discover`)return{stdout:``,stderr:`Unknown subcommand: ${o}. See \`local-llm --help\`.\n`,exitCode:2};let s=r(Dk);if(!s)return{stdout:``,stderr:`Local LLM is not configured. Open Settings → Providers → Local LLM and set a base URL.
|
|
1566
1566
|
`,exitCode:1};let c=await a(s,t(Dk)??void 0);if(!c.ok)return jk(s,c);if(o===`discover`){let e=n(Dk)??``;return i(Dk,e,s,c.models.join(`, `)),Nk(s,c)}return Mk(s,c)})}function Fk(){return{stdout:`usage: man <topic>
|
|
1567
1567
|
|
|
1568
1568
|
Fetches documentation for a given topic from sliccy.com.
|
|
@@ -1600,20 +1600,20 @@ authorization-code flow, stores the access token, and retries.
|
|
|
1600
1600
|
On success, the server is persisted to /workspace/.mcp/servers.json and
|
|
1601
1601
|
an alias shim is written to /workspace/.mcp/aliases/<name>.jsh so the
|
|
1602
1602
|
short name resolves on the PATH.
|
|
1603
|
-
`);let n=C(e,{});if(`error`in n)return Vk(n.error);if(n.positionals.length<2)return G(`mcp add: expected <url> <name>`);let[r,i]=n.positionals;if(!/^https?:\/\//i.test(r))return G(`mcp add: invalid URL "${r}" (must start with http:// or https://)`);if(!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))return G(`mcp add: invalid name "${i}" (letters, digits, _ and - only; must start with a letter)`);let{getServer:a,setServer:o}=await import(`./store-
|
|
1603
|
+
`);let n=C(e,{});if(`error`in n)return Vk(n.error);if(n.positionals.length<2)return G(`mcp add: expected <url> <name>`);let[r,i]=n.positionals;if(!/^https?:\/\//i.test(r))return G(`mcp add: invalid URL "${r}" (must start with http:// or https://)`);if(!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))return G(`mcp add: invalid name "${i}" (letters, digits, _ and - only; must start with a letter)`);let{getServer:a,setServer:o}=await import(`./store-VxOSzjl-.js`).then(e=>e.r);if(await a(i,t.fs))return G(`mcp add: a server named "${i}" already exists`);let{McpClient:s,McpAuthRequiredError:c}=await import(`./client-CwxmlQM-.js`).then(e=>e.n),l=new s({url:r,fetchImpl:t.fetchImpl}),u;try{await l.initialize()}catch(e){if(!(e instanceof c))throw e;u=await Gk(r,i,e.resourceMetadataUrl,t),l=new s({url:r,fetchImpl:t.fetchImpl,getAuthHeader:()=>bA(i)}),await l.initialize()}let d=await l.toolsList(),f=await l.appsList(),p=new Date().toISOString();await o(i,{url:r,protocolVersion:l.getNegotiatedProtocolVersion(),tools:d,apps:f,addedAt:p,lastRefreshedAt:p,...u?{auth:u}:{}},t.fs),await TA(i,t);let m=await OA(i,f,t);if(u){let{registerMcpProvider:e}=await import(`./provider-BKs9CsfU.js`);e({name:i,serverUrl:r,auth:u})}return W([`Added MCP server "${i}" → ${r}`,` tools: ${d.length}, apps: ${f.length} (${m} sprinkle${m===1?``:`s`})`,` alias: ${Bk}/${i}.jsh`,u?` auth: oauth (provider mcp:${i})`:` auth: none`].join(`
|
|
1604
1604
|
`)+`
|
|
1605
|
-
`)}async function Gk(e,t,n,r){let{discoverAuth:i,dynamicRegister:a,runAuthFlow:o}=await import(`./oauth-D20BEoY6.js`),{saveOAuthAccount:s}=await import(`./account-store-
|
|
1606
|
-
`);let n=C(e,{});if(`error`in n)return Vk(n.error);let{ensureAllMcpProvidersRegistered:r}=await import(`./provider-
|
|
1605
|
+
`)}async function Gk(e,t,n,r){let{discoverAuth:i,dynamicRegister:a,runAuthFlow:o}=await import(`./oauth-D20BEoY6.js`),{saveOAuthAccount:s}=await import(`./account-store-BQYiWjX3.js`).then(e=>e.t),c=await SA(r.oauthFetchImpl),l=r.oauthLauncher??await xA(),u=await i(e,n,c);zk.debug(`MCP OAuth discovery succeeded`,{name:t,serverUrl:e,discoveryPath:u.discoveryPath,issuer:u.issuer});let d=await ca(Ce()),f=await a(u,d,c),p=u.supportedScopes&&u.supportedScopes.length>0?u.supportedScopes.join(` `):void 0,m=await o({asMetadata:u,clientId:f.clientId,scope:p,redirectUri:d,launcher:l,fetchImpl:c}),h=`mcp:${t}`;return await s({providerId:h,accessToken:m.accessToken,refreshToken:m.refreshToken,tokenExpiresAt:m.expiresAt,scopes:m.scope}),{providerId:h,authorizationServer:u.issuer,clientId:f.clientId,redirectUri:d,scope:m.scope??p,registrationClientUri:f.registrationClientUri}}async function Kk(e,t){if(w(e))return W(`usage: mcp list
|
|
1606
|
+
`);let n=C(e,{});if(`error`in n)return Vk(n.error);let{ensureAllMcpProvidersRegistered:r}=await import(`./provider-BKs9CsfU.js`);await r();let{listServers:i}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),a=await i(t.fs),o=Object.keys(a).sort();if(o.length===0)return W("No MCP servers configured. Use `mcp add <url> <name>`.\n");let s=[[`NAME`,`URL`,`AUTH`,`TOOLS`,`APPS`,`ADDED`]];for(let e of o){let t=a[e];s.push([e,t.url,t.auth?`yes`:`no`,String(t.tools?.length??0),String(t.apps?.length??0),t.addedAt?t.addedAt.slice(0,10):`-`])}return W(qk(s))}function qk(e){let t=e[0].map((t,n)=>e.reduce((e,t)=>Math.max(e,(t[n]??``).length),0));return e.map(e=>e.map((e,n)=>e.padEnd(t[n])).join(` `).trimEnd()).join(`
|
|
1607
1607
|
`)+`
|
|
1608
1608
|
`}async function Jk(e,t){if(w(e))return W(`usage: mcp search <query>
|
|
1609
1609
|
|
|
1610
1610
|
Case-insensitive substring search across the cached tools of every
|
|
1611
1611
|
registered MCP server. Matches tool name OR description and prints a
|
|
1612
1612
|
table of (server, tool, description, match-field) rows.
|
|
1613
|
-
`);let n=C(e,{});if(`error`in n)return Vk(n.error);if(n.positionals.length===0)return G(`mcp search: expected <query>`);let r=n.positionals[0],i=r.toLowerCase(),{ensureAllMcpProvidersRegistered:a}=await import(`./provider-
|
|
1614
|
-
`);let n=C(e,{});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp delete: expected <name>`);let{ensureMcpProviderRegistered:i,removeMcpProvider:a}=await import(`./provider-
|
|
1613
|
+
`);let n=C(e,{});if(`error`in n)return Vk(n.error);if(n.positionals.length===0)return G(`mcp search: expected <query>`);let r=n.positionals[0],i=r.toLowerCase(),{ensureAllMcpProvidersRegistered:a}=await import(`./provider-BKs9CsfU.js`);await a();let{listServers:o}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),s=await o(t.fs),c=Object.keys(s).sort();if(c.length===0)return W("No MCP servers configured. Use `mcp add <url> <name>`.\n");let l=[];for(let e of c){let t=s[e].tools??[];for(let n of t){let t=n.description??``,r=n.name.toLowerCase().includes(i),a=t.toLowerCase().includes(i);if(!r&&!a)continue;let o=r&&a?`name+description`:r?`name`:`description`;l.push({server:e,tool:n.name,description:t,match:o})}}if(l.length===0)return W(`No tools matched "${r}".\n`);l.sort((e,t)=>e.server===t.server?e.tool.localeCompare(t.tool):e.server.localeCompare(t.server));let u=[[`SERVER`,`TOOL`,`DESCRIPTION`,`MATCH`]];for(let e of l)u.push([e.server,e.tool,Yk(e.description),e.match]);return W(qk(u))}function Yk(e){if(!e)return``;let t=e.replace(/\s+/g,` `).trim();return t.length<=60?t:t.slice(0,59)+`…`}async function Xk(e,t){if(e.length===0||w(e))return e.length===0?G(`mcp delete: expected <name>`):W(`usage: mcp delete <name>
|
|
1614
|
+
`);let n=C(e,{});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp delete: expected <name>`);let{ensureMcpProviderRegistered:i,removeMcpProvider:a}=await import(`./provider-BKs9CsfU.js`);await i(r);let{deleteServer:o}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),s=await o(r,t.fs);await EA(r,t),await DA(r,t);let c=`mcp:${r}`,l=!1;try{let{removeAccount:e,getAccounts:t}=await import(`./account-store-BQYiWjX3.js`).then(e=>e.t);t().some(e=>e.providerId===c)&&(await e(c),l=!0)}catch(e){zk.warn(`mcp delete: OAuth removal failed`,{providerId:c,error:e instanceof Error?e.message:String(e)})}let u=a(r);return!s&&!l&&!u?G(`mcp delete: no server, alias, or account found for "${r}"`):W([`Removed MCP server "${r}"`,` servers.json: ${s?`removed`:`not present`}`,` alias: cleaned`,` sprinkles: cleaned`,` oauth: ${l?`removed`:`not present`}`,` provider: ${u?`unregistered`:`not registered`}`].join(`
|
|
1615
1615
|
`)+`
|
|
1616
|
-
`)}async function Zk(e,t){if(e.length===0)return G(`mcp invoke: expected <name>`);if(w(e.slice(0,1)))return W(eA());let n=C([e[0]],{});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp invoke: expected <name>`);let i=e.slice(1),{ensureMcpProviderRegistered:a}=await import(`./provider-
|
|
1616
|
+
`)}async function Zk(e,t){if(e.length===0)return G(`mcp invoke: expected <name>`);if(w(e.slice(0,1)))return W(eA());let n=C([e[0]],{});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp invoke: expected <name>`);let i=e.slice(1),{ensureMcpProviderRegistered:a}=await import(`./provider-BKs9CsfU.js`);await a(r);let{getServer:o}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),s=await o(r,t.fs);if(!s)return G(`mcp invoke: unknown server "${r}" (run \`mcp add <url> ${r}\` first)`);let c=s.tools??[];if(i.length===0||w(i.slice(0,1)))return W(tA(r,s,c));let l=C([i[0]],{});if(`error`in l)return Vk(l.error);let u=l.positionals[0];if(!u)return G(`mcp invoke: expected <tool>`);let d=c.find(e=>e.name===u);if(!d)return G(`mcp invoke: unknown tool "${u}" on "${r}" (run \`${r}\` to list tools)`);let{timeoutMs:f,remaining:p,warnings:m}=Qk(i.slice(1));if(w(p))return W(rA(r,d));let h=iA(p,d.inputSchema);if(!h.ok)return G(`mcp invoke: ${h.error}`);let{McpClient:g}=await import(`./client-CwxmlQM-.js`).then(e=>e.n),_=new g({url:s.url,fetchImpl:t.fetchImpl,headers:s.headers,getAuthHeader:s.auth?()=>bA(r):void 0,...f===void 0?{}:{timeoutMs:f}});await _.initialize();let v=gA(await _.toolsCall(u,h.value));return m.length>0&&(v.stderr=m.map(e=>`${e}\n`).join(``)+v.stderr),v}function Qk(e){let t=[],n=[],r,i=0;for(;i<e.length;){let a=e[i];if(a.startsWith(`--timeout=`)){let e=$k(a.slice(10));e.ok?r=e.value:n.push(e.error),i+=1;continue}if(a===`--timeout`){let t=e[i+1];if(t===void 0||t.startsWith(`--`)){n.push(`mcp invoke: --timeout requires a value (got ${t===void 0?`nothing`:`"${t}"`}); using default.`),i+=1;continue}let a=$k(t);a.ok?r=a.value:n.push(a.error),i+=2;continue}t.push(a),i+=1}return{timeoutMs:r,remaining:t,warnings:n}}function $k(e){if(!/^-?\d+$/.test(e))return{ok:!1,error:`mcp invoke: invalid --timeout value "${e}" (expected positive integer seconds); using default.`};let t=Number(e);return!Number.isFinite(t)||t<1?{ok:!1,error:`mcp invoke: invalid --timeout value "${e}" (must be >= 1 second); using default.`}:{ok:!0,value:t*1e3}}function eA(){return`usage: mcp invoke <name> [tool] [--timeout <seconds>] [--flag value …]
|
|
1617
1617
|
|
|
1618
1618
|
mcp invoke <name> List tools on <name>.
|
|
1619
1619
|
mcp invoke <name> <tool> --help Show flags for <tool>.
|
|
@@ -1646,7 +1646,7 @@ Arguments are coerced according to the tool's JSON Schema:
|
|
|
1646
1646
|
|
|
1647
1647
|
Re-fetches the tool catalog and \`apps/list\` for <name>. Does NOT refresh
|
|
1648
1648
|
OAuth tokens — for OAuth token refresh use \`mcp auth <name>\`.
|
|
1649
|
-
`);let n=C(e,{});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp refresh: expected <name>`);let{ensureMcpProviderRegistered:i}=await import(`./provider-
|
|
1649
|
+
`);let n=C(e,{});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp refresh: expected <name>`);let{ensureMcpProviderRegistered:i}=await import(`./provider-BKs9CsfU.js`);await i(r);let{getServer:a,setServer:o}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),s=await a(r,t.fs);if(!s)return G(`mcp refresh: unknown server "${r}"`);let{McpClient:c,McpAuthRequiredError:l}=await import(`./client-CwxmlQM-.js`).then(e=>e.n),u=new c({url:s.url,fetchImpl:t.fetchImpl,headers:s.headers,getAuthHeader:s.auth?()=>bA(r):void 0});try{await u.initialize()}catch(e){if(e instanceof l)return G(`mcp refresh: server "${r}" returned 401 — token may have expired. Run \`mcp auth ${r}\` to re-authenticate.`);throw e}let d=await u.toolsList(),f=await u.appsList();await o(r,{...s,protocolVersion:u.getNegotiatedProtocolVersion(),tools:d,apps:f,lastRefreshedAt:new Date().toISOString()},t.fs);let p=await OA(r,f,t);return W(`Refreshed "${r}" — tools: ${d.length}, apps: ${f.length} (${p} sprinkle${p===1?``:`s`})\n`)}async function vA(e,t){if(w(e))return W(`usage: mcp auth <name> [--silent | --interactive]
|
|
1650
1650
|
|
|
1651
1651
|
Re-authenticate an existing MCP server. By default, attempts a silent
|
|
1652
1652
|
token renewal using the persisted refresh_token; if that returns no
|
|
@@ -1658,7 +1658,7 @@ Options:
|
|
|
1658
1658
|
-i, --interactive Skip silent renewal and open the OAuth popup
|
|
1659
1659
|
directly. Use after revoking a refresh token or
|
|
1660
1660
|
when the AS no longer accepts the cached one.
|
|
1661
|
-
`);let n=C(e,{bool:Rk});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp auth: expected <name>`);let i=n.bools.has(`--silent`)||n.bools.has(`-s`),a=n.bools.has(`--interactive`)||n.bools.has(`-i`);if(i&&a)return G(`mcp auth: --silent and --interactive are mutually exclusive`);let{ensureMcpProviderRegistered:o}=await import(`./provider-
|
|
1661
|
+
`);let n=C(e,{bool:Rk});if(`error`in n)return Vk(n.error);let r=n.positionals[0];if(!r)return G(`mcp auth: expected <name>`);let i=n.bools.has(`--silent`)||n.bools.has(`-s`),a=n.bools.has(`--interactive`)||n.bools.has(`-i`);if(i&&a)return G(`mcp auth: --silent and --interactive are mutually exclusive`);let{ensureMcpProviderRegistered:o}=await import(`./provider-BKs9CsfU.js`),s=await o(r,{fetchImpl:t.oauthFetchImpl,launcher:t.oauthLauncher}),{getServer:c}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),l=await c(r,t.fs);if(!l)return G(`mcp auth: unknown server "${r}" (run \`mcp list\` to see configured servers)`);if(!l.auth)return G(`mcp auth: server "${r}" does not use OAuth`);if(!s)return G(`mcp auth: failed to register provider for "${r}"`);let u=`mcp:${r}`,{getRegisteredProviderConfig:d}=await import(`./providers-BHHpCtcj.js`).then(e=>e.r),f=d(u);if(!f)return G(`mcp auth: provider "${u}" is not registered`);if(a)return await yA(r,f,t);if(!f.onSilentRenew)return i?G(`mcp auth: provider "${u}" does not support silent renewal; retry without --silent`):await yA(r,f,t);let p=null;try{p=await f.onSilentRenew()}catch(e){let t=e instanceof Error?e.message:String(e);if(i)return G(`mcp auth: silent renewal for "${r}" failed (${t}); retry without --silent to run the interactive flow`);zk.debug(`mcp auth: silent renewal threw, falling back to interactive`,{name:r,error:t})}return p?W(`Re-authenticated "${r}" via silent renewal (provider ${u})\n`):i?G(`mcp auth: silent renewal for "${r}" returned no token; retry without --silent to run the interactive flow`):await yA(r,f,t)}async function yA(e,t,n){if(!t.onOAuthLogin)return G(`mcp auth: provider "${t.id}" does not support interactive OAuth login`);let r=n.oauthLauncher??await xA(),i=!1;return await t.onOAuthLogin(r,()=>{i=!0}),i?W(`Re-authenticated "${e}" via interactive login (provider ${t.id})\n`):G(`mcp auth: interactive login for "${e}" did not complete`)}async function bA(e){let t=`mcp:${e}`,{getOAuthAccountInfo:n}=await import(`./account-store-BQYiWjX3.js`).then(e=>e.t),r=n(t);if(!r)return null;if(r.expired){try{let{getRegisteredProviderConfig:e}=await import(`./providers-BHHpCtcj.js`).then(e=>e.r),n=await e(t)?.onSilentRenew?.();if(n)return`Bearer ${n}`}catch(e){zk.debug(`silent renewal threw`,{providerId:t,error:e instanceof Error?e.message:String(e)})}return null}return`Bearer ${r.token}`}async function xA(){let{createOAuthLauncher:e}=await import(`./oauth-service-DP3Rx6V_.js`);return e()}async function SA(e){if(e)return e;let{createProxiedFetch:t}=await import(`./proxied-fetch-DXaTHROw.js`).then(e=>e.a),n=t();return async(e,t)=>{let r=await n(e,{method:t?.method,headers:t?.headers,body:t?.body}),i=new TextDecoder().decode(r.body);return{ok:r.status>=200&&r.status<300,status:r.status,statusText:r.statusText,text:async()=>i,json:async()=>JSON.parse(i),headers:{get:e=>r.headers[e.toLowerCase()]??null}}}}async function CA(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-CSXuJafL.js`).then(e=>e.t),{GLOBAL_FS_DB_NAME:n}=await import(`./global-db-DJXlpNui.js`).then(e=>e.n);return await t.create({dbName:n})}function wA(e){return`// MCP alias for "${e}" — forwards args to \`mcp invoke ${e}\`.
|
|
1662
1662
|
// Auto-generated by \`mcp add ${e}\`; do not edit by hand.
|
|
1663
1663
|
const { promisify } = require('util');
|
|
1664
1664
|
const { exec } = require('child_process');
|
|
@@ -1687,7 +1687,7 @@ try {
|
|
|
1687
1687
|
if (stdout) process.stdout.write(stdout);
|
|
1688
1688
|
if (stderr) process.stderr.write(stderr);
|
|
1689
1689
|
process.exit(exitCode);
|
|
1690
|
-
`}async function TA(e,t){let n=await CA(t.fs);await n.mkdir(Bk,{recursive:!0}),await n.writeFile(`${Bk}/${e}.jsh`,wA(e)),t.scriptCatalog?.invalidateJsh()}async function EA(e,t){let n=await CA(t.fs),r=`${Bk}/${e}.jsh`;try{await n.exists(r)&&await n.rm(r)}catch(e){zk.debug(`alias removal failed`,{path:r,error:e instanceof Error?e.message:String(e)})}t.scriptCatalog?.invalidateJsh()}async function DA(e,t){let{removeAppSprinkles:n}=await import(`./apps-
|
|
1690
|
+
`}async function TA(e,t){let n=await CA(t.fs);await n.mkdir(Bk,{recursive:!0}),await n.writeFile(`${Bk}/${e}.jsh`,wA(e)),t.scriptCatalog?.invalidateJsh()}async function EA(e,t){let n=await CA(t.fs),r=`${Bk}/${e}.jsh`;try{await n.exists(r)&&await n.rm(r)}catch(e){zk.debug(`alias removal failed`,{path:r,error:e instanceof Error?e.message:String(e)})}t.scriptCatalog?.invalidateJsh()}async function DA(e,t){let{removeAppSprinkles:n}=await import(`./apps-D_FfUPg-.js`);await n(e,t.fs)}async function OA(e,t,n){try{let{materializeAppSprinkles:r}=await import(`./apps-D_FfUPg-.js`);return(await r(e,t,n.fs)).length}catch(t){return zk.warn(`mcp: failed to materialize app sprinkles`,{name:e,error:t instanceof Error?t.message:String(t)}),0}}function kA(e){return{stdout:``,stderr:`meminfo: ${e}\n`,exitCode:1}}function AA(e){return e.attribution.length===0?`(shared)`:e.attribution.map(e=>{let t=e.container?.src??e.container?.id??e.url??`?`;return e.scope?`${e.scope} ${t}`:t}).join(`, `)}function jA(){let e=globalThis.performance,t=e?.measureUserAgentSpecificMemory;return t?t.bind(e):null}function MA(e){if(e[0]===`--help`||e[0]===`-h`||e[0]===`help`)return{help:!0};let t=!1;for(let n of e){if(n!==`--json`)return{error:`unknown option '${n}' — see \`meminfo --help\``};t=!0}return{help:!1,json:t}}function NA(e){let t=[`total: ${xy(e.bytes)}`],n=[...e.breakdown].filter(e=>e.bytes>0).sort((e,t)=>t.bytes-e.bytes);if(n.length>0){t.push(``,`BYTES TYPES ATTRIBUTION`);for(let e of n)t.push(`${xy(e.bytes).padEnd(10)} ${e.types.join(`,`).padEnd(20)} ${AA(e)}`)}return`${t.join(`
|
|
1691
1691
|
`)}\n`}function PA(e={}){return S(`meminfo`,async t=>{let n=MA(t);if(`error`in n)return kA(n.error);if(n.help)return{stdout:`meminfo - agent-cluster memory diagnostics
|
|
1692
1692
|
|
|
1693
1693
|
Usage:
|
|
@@ -1699,7 +1699,7 @@ Notes:
|
|
|
1699
1699
|
Document-Isolation-Policy). Embedded floats cannot be isolated and
|
|
1700
1700
|
report why instead.
|
|
1701
1701
|
- The browser randomizes measurement timing — expect a short delay.
|
|
1702
|
-
`,stderr:``,exitCode:0};let r=e.isIsolated?e.isIsolated():globalThis.crossOriginIsolated===!0,i=e.measure??jA();if(!r&&!e.measure)return kA(`memory measurement requires a cross-origin-isolated runtime (Document-Isolation-Policy) — this runtime is not isolated`);if(!i)return kA(`performance.measureUserAgentSpecificMemory is not available in this browser`);let a;try{a=await i()}catch(e){return kA(e instanceof Error?e.message:String(e))}return n.json?{stdout:`${JSON.stringify(a,null,2)}\n`,stderr:``,exitCode:0}:{stdout:NA(a),stderr:``,exitCode:0}})}function FA(e){return S(`memory`,async t=>{let{runMemory:n}=await import(`./run-
|
|
1702
|
+
`,stderr:``,exitCode:0};let r=e.isIsolated?e.isIsolated():globalThis.crossOriginIsolated===!0,i=e.measure??jA();if(!r&&!e.measure)return kA(`memory measurement requires a cross-origin-isolated runtime (Document-Isolation-Policy) — this runtime is not isolated`);if(!i)return kA(`performance.measureUserAgentSpecificMemory is not available in this browser`);let a;try{a=await i()}catch(e){return kA(e instanceof Error?e.message:String(e))}return n.json?{stdout:`${JSON.stringify(a,null,2)}\n`,stderr:``,exitCode:0}:{stdout:NA(a),stderr:``,exitCode:0}})}function FA(e){return S(`memory`,async t=>{let{runMemory:n}=await import(`./run-BFNlKi_A.js`);return n(t,e)})}function IA(){return S(`mktemp`,async(e,t)=>{let{runMktemp:n}=await import(`./run-dAJe7sKp.js`);return n(e,t)})}const LA=`/.cache/artificial-analysis.json`,RA=[`--all`,`--all-versions`,`--json`,`--refresh`,`--no-benchmarks`,`--help`,`-h`],zA=[`--provider`];function BA(e){return{stdout:``,stderr:e.endsWith(`
|
|
1703
1703
|
`)?e:`${e}\n`,exitCode:1}}async function VA(e){try{let t=await e.readFile(LA),n=JSON.parse(t);if(Date.now()-n.fetchedAt<864e5)return n.models}catch{}return null}function HA(){try{return localStorage.getItem(`aa_api_key`)}catch{return null}}function UA(e){return e.map(e=>{let t=e;return{slug:t.slug??``,name:t.name??``,creator_slug:t.model_creator?.slug??``,intelligence_index:t.evaluations?.artificial_analysis_intelligence_index??null,coding_index:t.evaluations?.artificial_analysis_coding_index??null,speed_tps:t.median_output_tokens_per_second??null}})}async function WA(e,t){let n={fetchedAt:Date.now(),models:t};try{await e.mkdir(`/.cache`,{recursive:!0}),await e.writeFile(LA,JSON.stringify(n))}catch{}}async function GA(e,t=!1){if(e&&!t){let t=await VA(e);if(t)return t}let n={Accept:`application/json`},r=HA();r&&(n[`x-api-key`]=r);let i=p(),a;try{a=await i(`https://artificialanalysis.ai/api/v2/data/llms/models`,{method:`GET`,headers:n})}catch{return[]}if(a.status===401||a.status<200||a.status>=300)return[];let o;try{o=JSON.parse(new TextDecoder().decode(a.body))}catch{return[]}if(typeof o!=`object`||!o)return[];let s=o,c=UA(Array.isArray(s)?s:s.data??s.models??[]);return e&&c.length>0&&await WA(e,c),c}function KA(e){return e.toLowerCase().replace(/\./g,`-`).replace(/-\d{8}$/,``).replace(/-\d{4}$/,``)}function qA(e,t){let n=e.toLowerCase(),r=t.find(e=>e.slug===n);if(r)return r;let i=KA(e),a=t.find(e=>KA(e.slug)===i);if(a)return a;let o=t.filter(e=>n.includes(e.slug)||e.slug.includes(n));if(o.length!==0)return o.sort((e,t)=>t.slug.length-e.slug.length),o[0]}function JA(){return`models - list available LLM models
|
|
1704
1704
|
|
|
1705
1705
|
Usage: models [options]
|
|
@@ -1714,7 +1714,7 @@ Options:
|
|
|
1714
1714
|
-h, --help Show this help message
|
|
1715
1715
|
`}function YA(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`.replace(`.0M`,`M`):e>=1e3?`${(e/1e3).toFixed(0)}K`:`${e}`}function XA(e){return`$${e.toFixed(2)}`}const ZA=/\b(embedding|embed|tts|whisper|dall-e|image-gen|audio|vision-preview)\b/i;function QA(e){let t=`${e.id} ${e.name??``}`;return!ZA.test(t)}function $A(e){let t=e.match(/^(claude-(?:opus|sonnet|haiku))/);if(t)return t[1];let n=e.match(/^(gpt-\d+)(?:\.\d+)?(-[a-z][-a-z]*)?$/);if(n)return n[1]+(n[2]??``);let r=e.match(/^gemini-[\d.]+-(.+)$/);if(r)return`gemini-${r[1]}`;let i=e.match(/^gemini-(\d+)-(.+)$/);if(i)return`gemini-${i[2]}`;let a=e.match(/^grok-[\d.]+-([\w-]+)$/);if(a)return`grok-${a[1]}`;if(e.match(/^(grok)-[\d.]+$/))return`grok`;let o=e.match(/^(o\d+(?:-[a-z]+)?)(?:-\d.*)?$/);if(o)return o[1]}function ej(e){let t=e.toLowerCase();return t=t.replace(/-\d{8}$/,``),t=t.replace(/-\d{4}$/,``),t=t.replace(/-(preview|latest)$/,``),$A(t)??t.replace(/-[\d.]+$/,``)}function tj(e){let t=new Map;for(let n of e){let e=ej(n.id);(!t.has(e)||n.selected)&&t.set(e,n)}return[...t.values()]}function nj(e,t,n,r,i){let a=i?qA(e.id,i):void 0,o={id:e.id,name:e.name,provider:t,cost:e.cost??{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:e.contextWindow??0,maxTokens:e.maxTokens??0,reasoning:!!e.reasoning,input:e.input??[`text`],selected:e.id===n&&t===r};return a?.intelligence_index!=null&&(o.intelligence=a.intelligence_index),a?.coding_index!=null&&(o.codingScore=a.coding_index),a?.speed_tps!=null&&(o.speed=a.speed_tps),o}function rj(e,t,n,r){let i=[];i.push(`Models for "${e}" (${t}):\n`);for(let e of n){let t=e.selected?` ► `:` `,n=e.id.padEnd(30),r=`${XA(e.cost.input)} / ${XA(e.cost.output)}`,a=`${YA(e.contextWindow)} ctx`,o=e.intelligence==null?``:`IQ:${e.intelligence}`,s=e.speed==null?``:`${Math.round(e.speed)} t/s`,c=e.reasoning?`reasoning`:``,l=o||s?`${o.padEnd(6)} ${s.padEnd(8)}`:``;i.push(`${t}${n} ${r.padEnd(16)} ${a.padEnd(10)} ${l} ${c}`)}return i.push(`\n ${n.length} model${n.length===1?``:`s`} available.`),r&&i.push(` Intelligence data: artificialanalysis.ai`),i.join(`
|
|
1716
1716
|
`)+`
|
|
1717
|
-
`}function ij(e){let t=C(e,{bool:RA,value:zA});return`error`in t?t:{jsonMode:t.bools.has(`--json`),allMode:t.bools.has(`--all`),allVersions:t.bools.has(`--all-versions`),forceRefresh:t.bools.has(`--refresh`),noBenchmarks:t.bools.has(`--no-benchmarks`),explicitProvider:t.values.get(`--provider`)}}function aj(e,t,n){if(t.explicitProvider){let n=e.getAvailableProviders();return n.includes(t.explicitProvider)?[t.explicitProvider]:{error:`Unknown provider: ${t.explicitProvider}. Available: ${n.join(`, `)}\n`}}return t.allMode?[...new Set(e.getAccounts().map(e=>e.providerId))]:[n]}function oj(e,t,n,r,i,a){let o=e.getProviderModels(t).filter(QA);if(o.length===0)return[];let s=o.map(e=>nj(e,t,n,r,i)).sort((e,t)=>t.cost.input-e.cost.input);return a||(s=tj(s)),s}function sj(e,t,n,r){let i=`${e}:${t}`,a=`${n}:${r}`;return i===a?`Currently using: ${i}\n`:`Currently using: ${i} (selected ${a} — resolved to a different model)\n`}async function cj(e,t){if(w(e,{valueFlags:zA}))return{stdout:JA(),stderr:``,exitCode:0};let n=ij(e);if(`error`in n)return BA(`models: ${n.error}`);let r=await import(`./account-store-
|
|
1717
|
+
`}function ij(e){let t=C(e,{bool:RA,value:zA});return`error`in t?t:{jsonMode:t.bools.has(`--json`),allMode:t.bools.has(`--all`),allVersions:t.bools.has(`--all-versions`),forceRefresh:t.bools.has(`--refresh`),noBenchmarks:t.bools.has(`--no-benchmarks`),explicitProvider:t.values.get(`--provider`)}}function aj(e,t,n){if(t.explicitProvider){let n=e.getAvailableProviders();return n.includes(t.explicitProvider)?[t.explicitProvider]:{error:`Unknown provider: ${t.explicitProvider}. Available: ${n.join(`, `)}\n`}}return t.allMode?[...new Set(e.getAccounts().map(e=>e.providerId))]:[n]}function oj(e,t,n,r,i,a){let o=e.getProviderModels(t).filter(QA);if(o.length===0)return[];let s=o.map(e=>nj(e,t,n,r,i)).sort((e,t)=>t.cost.input-e.cost.input);return a||(s=tj(s)),s}function sj(e,t,n,r){let i=`${e}:${t}`,a=`${n}:${r}`;return i===a?`Currently using: ${i}\n`:`Currently using: ${i} (selected ${a} — resolved to a different model)\n`}async function cj(e,t){if(w(e,{valueFlags:zA}))return{stdout:JA(),stderr:``,exitCode:0};let n=ij(e);if(`error`in n)return BA(`models: ${n.error}`);let r=await import(`./account-store-BQYiWjX3.js`).then(e=>e.t);if(r.getAccounts().length===0)return BA(`No provider accounts configured. Run the provider settings to add one.
|
|
1718
1718
|
`);let i=r.resolveCurrentModel(),a=i.id,o=i.provider,s=r.getSelectedProvider(),c=r.getSelectedModelId(),l;if(!n.noBenchmarks){let e=await GA(t,n.forceRefresh);e.length>0&&(l=e)}let u=aj(r,n,s);if(`error`in u)return BA(u.error);let d=[],f=[];for(let e of u){let t=oj(r,e,a,o,l,n.allVersions);if(t.length===0){if(!n.allMode)return BA(`No models available for provider ${e}.\n`);continue}if(d.push(...t),!n.jsonMode){let n=r.getProviderConfig(e);f.push(rj(n.name,e,t,!!l))}}return n.jsonMode?{stdout:JSON.stringify(d,null,2)+`
|
|
1719
1719
|
`,stderr:``,exitCode:0}:(n.allVersions||f.push(`Showing latest versions only. Use --all-versions to see all.
|
|
1720
1720
|
`),f.push(sj(o,a,s,c)),{stdout:f.join(`
|
|
@@ -1772,7 +1772,7 @@ Examples:
|
|
|
1772
1772
|
`)}\n`,stderr:``,exitCode:0}}async function Nj(e,t,n){if(!t||!n)return{stdout:``,stderr:`oauth-domain add: requires <providerId> and <domain>
|
|
1773
1773
|
`,exitCode:1};let r=e.getExtraOAuthDomains(t),i=n.toLowerCase();return r.some(e=>e.toLowerCase()===i)?{stdout:`(${n} already in ${t} extras)\n`,stderr:``,exitCode:0}:(await e.setExtraOAuthDomainsAsync(t,[...r,n]),{stdout:`Added ${n} to ${t}. Reload the page to apply.\n`,stderr:``,exitCode:0})}async function Pj(e,t,n){if(!t||!n)return{stdout:``,stderr:`oauth-domain remove: requires <providerId> and <domain>
|
|
1774
1774
|
`,exitCode:1};let r=e.getExtraOAuthDomains(t),i=n.toLowerCase(),a=r.filter(e=>e.toLowerCase()!==i);return a.length===r.length?{stdout:`(${n} not found in ${t} extras)\n`,stderr:``,exitCode:0}:(await e.setExtraOAuthDomainsAsync(t,a),{stdout:`Removed ${n} from ${t}. Reload the page to apply.\n`,stderr:``,exitCode:0})}async function Fj(e,t){return t?(await e.setExtraOAuthDomainsAsync(t,[]),{stdout:`Cleared extra domains for ${t}. Reload the page to apply.\n`,stderr:``,exitCode:0}):{stdout:``,stderr:`oauth-domain clear: requires <providerId>
|
|
1775
|
-
`,exitCode:1}}async function Ij(e,t,n,r){switch(t){case`list`:return Mj(e,n);case`add`:return Nj(e,n,r);case`remove`:return Pj(e,n,r);case`clear`:return Fj(e,n);default:return{stdout:``,stderr:`oauth-domain: unknown subcommand "${t}"\n${Aj()}`,exitCode:1}}}function Lj(){return S(`oauth-domain`,async e=>{if(e.length===0||w(e))return{stdout:Aj(),stderr:``,exitCode:0};let t=C(e);if(`error`in t)return jj(t.error);let[n,r,i]=t.positionals,a=await import(`./account-store-
|
|
1775
|
+
`,exitCode:1}}async function Ij(e,t,n,r){switch(t){case`list`:return Mj(e,n);case`add`:return Nj(e,n,r);case`remove`:return Pj(e,n,r);case`clear`:return Fj(e,n);default:return{stdout:``,stderr:`oauth-domain: unknown subcommand "${t}"\n${Aj()}`,exitCode:1}}}function Lj(){return S(`oauth-domain`,async e=>{if(e.length===0||w(e))return{stdout:Aj(),stderr:``,exitCode:0};let t=C(e);if(`error`in t)return jj(t.error);let[n,r,i]=t.positionals,a=await import(`./account-store-BQYiWjX3.js`).then(e=>e.t);try{return await Ij(a,n,r,i)}catch(e){return jj(e instanceof Error?e.message:String(e))}})}function Rj(){return S(`oauth-token`,async(e,t)=>{let{runOAuthToken:n}=await import(`./run-BCk9I-td.js`);return n(e,t)})}const zj=[`--download`,`-d`,`--view`,`-v`],Bj=[`--size`],Vj={low:256,medium:768,high:1536};function Hj(){return{stdout:`usage: open [--download|-d] [--view|-v [--size <spec>]] <url|path> [url|path...]
|
|
1776
1776
|
|
|
1777
1777
|
VFS paths are served in a new browser tab via the preview service worker.
|
|
1778
1778
|
URLs (http/https/etc.) are opened directly in a new tab.
|
|
@@ -1798,7 +1798,7 @@ Examples:
|
|
|
1798
1798
|
`);let i=!1;try{i=(await t.fs.stat(e)).isDirectory}catch{}let a=await rr(t.fs,i?e:fr(e)),o=Pr(e,a),s;try{s=await r(o)}catch(e){return K(`${e instanceof Error?e.message:String(e)}\n`)}return Zj(`opened ${e} → ${o}${Qj(s)}`)}async function aM(e,t,n,r){if(!ar(e)&&e.endsWith(`.shtml`)&&t.fs)return eM(e,t,r.sprinkleManager,r.canOpenWindow,r.openExternal);if(!n.view&&!r.canOpenWindow)return K(`open: browser APIs are unavailable in this environment
|
|
1799
1799
|
`);if(ar(e))return tM(e,r.canOpenWindow,r.openExternal);let i=t.fs.resolvePath(t.cwd,e);return n.view?nM(e,i,t,n.sizeSpec):n.download?rM(e,i,t,r.hasDom):iM(i,t,r.canOpenWindow,r.openExternal)}function oM(e){return S(`open`,async(t,n)=>{if(t.length===0||w(t,{valueFlags:Bj}))return Hj();let r=Xj(t);if(`error`in r)return{stdout:``,stderr:`${r.error}\n`,exitCode:1};let{download:i,view:a,sizeSpec:o,targets:s}=r;if(s.length===0)return Hj();let c=globalThis.__slicc_sprinkleManager,l=typeof window<`u`&&typeof document<`u`,u=l?null:y(),d={canOpenWindow:!!e||l||!!u,hasDom:l,sprinkleManager:c,openExternal:$j(e,l,u)},f=[];for(let e of s){let t=await aM(e,n,{view:a,download:i,sizeSpec:o},d);if(!t.ok)return t.result;f.push(t.message)}return{stdout:f.join(`
|
|
1800
1800
|
`)+`
|
|
1801
|
-
`,stderr:``,exitCode:0}})}function sM(){return S(`patch`,async(e,t)=>{let{runPatch:n}=await import(`./run-
|
|
1801
|
+
`,stderr:``,exitCode:0}})}function sM(){return S(`patch`,async(e,t)=>{let{runPatch:n}=await import(`./run-6k6pQcEe.js`);return n(e,t)})}function cM(e=`pdftk`){return S(e,async(t,n)=>{let{runPdftk:r}=await import(`./run-BEs473Sp.js`);return r(e,t,n)})}function lM(){return{stdout:`usage: pdftoppm [options] <input.pdf> [output-prefix]
|
|
1802
1802
|
|
|
1803
1803
|
Rasterize PDF pages to images. Writes <prefix>-<n>.<ext> per page, where <n>
|
|
1804
1804
|
is zero-padded to the digit width of the last page (out-1.png for a 9-page
|
|
@@ -1858,7 +1858,7 @@ Examples:
|
|
|
1858
1858
|
plugin list
|
|
1859
1859
|
plugin info my-plugin
|
|
1860
1860
|
plugin remove my-plugin
|
|
1861
|
-
`}function EM(e={}){return S(`plugin`,async(t,n)=>{if(t.length===0||t[0]===`--help`||t[0]===`-h`)return CM(TM());let r=t[0],i=t.slice(1),a=n?.cwd??`/`;try{switch(r){case`install`:case`add`:return await NM(i,a,e);case`list`:case`ls`:return await LM(i,e);case`info`:return await RM(i,e);case`validate`:return await zM(i,a,e,Ki(n?.env));case`remove`:case`rm`:case`delete`:return await BM(i,e);default:return q(`plugin: unknown subcommand "${r}" (try \`plugin --help\`)`)}}catch(e){return q(`plugin ${r}: ${e instanceof Error?e.message:String(e)}`)}})}async function DM(e){if(e.fs)return e.fs;let{VirtualFS:t}=await import(`./fs-
|
|
1861
|
+
`}function EM(e={}){return S(`plugin`,async(t,n)=>{if(t.length===0||t[0]===`--help`||t[0]===`-h`)return CM(TM());let r=t[0],i=t.slice(1),a=n?.cwd??`/`;try{switch(r){case`install`:case`add`:return await NM(i,a,e);case`list`:case`ls`:return await LM(i,e);case`info`:return await RM(i,e);case`validate`:return await zM(i,a,e,Ki(n?.env));case`remove`:case`rm`:case`delete`:return await BM(i,e);default:return q(`plugin: unknown subcommand "${r}" (try \`plugin --help\`)`)}}catch(e){return q(`plugin ${r}: ${e instanceof Error?e.message:String(e)}`)}})}async function DM(e){if(e.fs)return e.fs;let{VirtualFS:t}=await import(`./fs-CSXuJafL.js`).then(e=>e.t),{GLOBAL_FS_DB_NAME:n}=await import(`./global-db-DJXlpNui.js`).then(e=>e.n);return t.create({dbName:n})}async function OM(e,t,n){let r=VM(t,e);if(await n.exists(r))return{kind:`local`,root:r};let{parseGitHubRef:i}=await import(`./github-install-BCFfvAe2.js`).then(e=>e.t),a=i(e);if(a){let e=`${a.owner}/${a.repo}${a.branch?`@${a.branch}`:``}${a.path?`/${a.path}`:``}`;return{kind:`github`,ref:{...a,display:e}}}return{kind:`error`,message:`${r} does not exist and "${e}" is not a GitHub reference (owner/repo[@branch] or https://github.com/owner/repo[/tree/branch[/dir]])`}}function kM(e){let t=e.replace(/[^A-Za-z0-9._-]+/g,`-`);return/^\.+$/.test(t)?t.replace(/\./g,`_`):t}function AM(e){let t=[e.owner,e.repo,...e.path?[e.path]:[]];return`${SM}/${t.map(kM).join(`--`)}`}async function jM(e,t,n,r){let{fetchRepoZip:i,stripZipPrefix:a,writeZipFilesToDir:o}=await import(`./github-zip-BJkh1FPE.js`).then(e=>e.i),s=await i(e.owner,e.repo,r,e.branch);if(s.status===`error`)return`failed to download ${e.display}: ${s.message}`;let c=a(s.files),l=e.path?e.path.replace(/^\/|\/$/g,``)+`/`:``;if(!c[`${l}plugin.json`])return`no plugin.json found at ${e.display} — not an Agent Plugins package`;try{await n.rm(t,{recursive:!0})}catch{}return await n.mkdir(t,{recursive:!0}),(await o(c,l,t,n,!1)).length===0?`no files found at ${e.display}`:null}async function MM(e,t){try{await e.rm(t,{recursive:!0})}catch{}}async function NM(e,t,n){if(w(e))return CM(`usage: plugin install <path|repo>
|
|
1862
1862
|
|
|
1863
1863
|
Loads the Agent Plugins package at <path>, or downloads it from a GitHub
|
|
1864
1864
|
reference (owner/repo, owner/repo@branch, or
|
|
@@ -1869,19 +1869,19 @@ mcp.json. On success the plugin is recorded in
|
|
|
1869
1869
|
/workspace/.plugins/plugins.json — its skills then surface through the
|
|
1870
1870
|
standard skills discovery, and each supported streamable-http MCP server
|
|
1871
1871
|
is registered in the MCP store as "<plugin>:<server>".
|
|
1872
|
-
`);let r=wM(`install`,e);if(!(`ok`in r))return r;if(r.positionals.length<1)return q(`plugin install: expected <path|repo>`);let i=await DM(n),a=await OM(r.positionals[0],t,i);if(a.kind===`error`)return q(`plugin install: ${a.message}`);let o,s;if(a.kind===`github`){if(!n.fetch)return q(`plugin install: GitHub installs are unavailable (no network fetch configured)`);o=AM(a.ref),s=a.ref.display;let e=await jM(a.ref,o,i,n.fetch);if(e)return q(`plugin install: ${e}`)}else o=a.root;let{loadPluginFromDirectory:c}=await import(`./loader-Dw-TPPKt.js`),l=await c(i,o);if(!l.ok)return a.kind===`github`&&await MM(i,o),q(`plugin install: plugin at ${s??o} was rejected:\n${HM(l.diagnostics)}`);let{plugin:u}=l,d=u.manifest.name,{getInstalledPlugin:f,setInstalledPlugin:p}=await import(`./store-
|
|
1872
|
+
`);let r=wM(`install`,e);if(!(`ok`in r))return r;if(r.positionals.length<1)return q(`plugin install: expected <path|repo>`);let i=await DM(n),a=await OM(r.positionals[0],t,i);if(a.kind===`error`)return q(`plugin install: ${a.message}`);let o,s;if(a.kind===`github`){if(!n.fetch)return q(`plugin install: GitHub installs are unavailable (no network fetch configured)`);o=AM(a.ref),s=a.ref.display;let e=await jM(a.ref,o,i,n.fetch);if(e)return q(`plugin install: ${e}`)}else o=a.root;let{loadPluginFromDirectory:c}=await import(`./loader-Dw-TPPKt.js`),l=await c(i,o);if(!l.ok)return a.kind===`github`&&await MM(i,o),q(`plugin install: plugin at ${s??o} was rejected:\n${HM(l.diagnostics)}`);let{plugin:u}=l,d=u.manifest.name,{getInstalledPlugin:f,setInstalledPlugin:p}=await import(`./store-B0SHnRWQ.js`),m=await f(d,n.fs);if(m&&m.root!==o)return a.kind===`github`&&await MM(i,o),q(`plugin install: a plugin named "${d}" is already installed from ${m.root} (remove it first)`);let h=await IM(u,n),g=await FM(d,m?.mcpServerNames,h.registered,n);return await p(d,{root:o,version:u.manifest.version,description:u.manifest.description,installedAt:new Date().toISOString(),mcpServerNames:h.registered,...s?{source:s}:{}},n.fs),CM(PM(u,h,g,s??o,l.diagnostics))}function PM(e,t,n,r,i){let a=e.manifest.name,o=t.registered,s=e.mcp.servers.filter(e=>e.status!==`supported`),c=[`Installed agent plugin "${a}"${e.manifest.version?` v${e.manifest.version}`:``} from ${r}`,` skills: ${e.skills.length}${e.skills.length>0?` (${e.skills.map(e=>e.name).join(`, `)})`:``}`,` mcp: ${o.length} registered${o.length>0?` (${o.join(`, `)})`:``}${s.length>0?`, ${s.length} skipped`:``}${n>0?`, ${n} removed from previous install`:``}`];return t.conflicts.length>0&&c.push(` warning: not bridged — MCP server name(s) already in use and not owned by this plugin: ${t.conflicts.join(`, `)} (remove them with \`mcp remove\` first)`),i.length>0&&c.push(`Diagnostics:`,HM(i)),c.join(`
|
|
1873
1873
|
`)+`
|
|
1874
|
-
`}async function FM(e,t,n,r){let i=(t??[]).filter(e=>!n.includes(e));if(i.length===0)return 0;let{deleteServer:a,getServer:o}=await import(`./store-
|
|
1875
|
-
`);let n=wM(`list`,e);if(!(`ok`in n))return n;let{listInstalledPlugins:r}=await import(`./store-
|
|
1874
|
+
`}async function FM(e,t,n,r){let i=(t??[]).filter(e=>!n.includes(e));if(i.length===0)return 0;let{deleteServer:a,getServer:o}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),s=0;for(let t of i)(await o(t,r.fs))?.pluginOrigin===e&&await a(t,r.fs)&&(s+=1);return s}async function IM(e,t){let n=e.mcp.servers.filter(e=>e.status===`supported`);if(n.length===0)return{registered:[],conflicts:[]};let{getServer:r,setServer:i}=await import(`./store-VxOSzjl-.js`).then(e=>e.r),{McpClient:a}=await import(`./client-CwxmlQM-.js`).then(e=>e.n),o=[],s=[];for(let c of n){let n=c.config,l=`${e.manifest.name}:${c.name}`,u=await r(l,t.fs);if(u&&u.pluginOrigin!==e.manifest.name){s.push(l);continue}let d=[];try{let e=new a({url:n.url,headers:n.headers});await e.initialize(),d=await e.toolsList()}catch{}await i(l,{url:n.url,...n.headers?{headers:n.headers}:{},tools:d,addedAt:new Date().toISOString(),pluginOrigin:e.manifest.name},t.fs),o.push(l)}return{registered:o,conflicts:s}}async function LM(e,t){if(w(e))return CM(`usage: plugin list
|
|
1875
|
+
`);let n=wM(`list`,e);if(!(`ok`in n))return n;let{listInstalledPlugins:r}=await import(`./store-B0SHnRWQ.js`),i=await r(t.fs),a=Object.keys(i).sort();if(a.length===0)return CM("No agent plugins installed. Use `plugin install <path>`.\n");let o=[[`NAME`,`VERSION`,`ROOT`,`MCP`]];for(let e of a){let t=i[e];o.push([e,t.version??`-`,t.root,String(t.mcpServerNames?.length??0)])}let s=o[0].map((e,t)=>Math.max(...o.map(e=>e[t].length)));return CM(o.map(e=>e.map((e,t)=>e.padEnd(s[t])).join(` `)).join(`
|
|
1876
1876
|
`)+`
|
|
1877
1877
|
`)}async function RM(e,t){if(w(e))return CM(`usage: plugin info <name>
|
|
1878
|
-
`);let n=wM(`info`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return q(`plugin info: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i}=await import(`./store-
|
|
1878
|
+
`);let n=wM(`info`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return q(`plugin info: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i}=await import(`./store-B0SHnRWQ.js`),a=await i(r,t.fs);if(!a)return q(`plugin info: no installed plugin named "${r}"`);let o=await DM(t),{loadPluginFromDirectory:s}=await import(`./loader-Dw-TPPKt.js`),c=await s(o,a.root);if(!c.ok)return q(`plugin info: plugin at ${a.root} no longer loads:\n${HM(c.diagnostics)}`);let{plugin:l}=c,u=l.manifest,d=[`${u.name}${u.version?` v${u.version}`:``}`,...u.description?[` ${u.description}`]:[],` root: ${l.root}`,...u.license?[` license: ${u.license}`]:[],...u.homepage?[` home: ${u.homepage}`]:[],``,`Skills (${l.skills.length}):`,...l.skills.map(e=>` ${e.name} ${e.description}`),``,`MCP servers (${l.mcp.servers.length}):`,...l.mcp.servers.map(e=>e.status===`supported`?` ${e.name} ${e.config.type} ${e.config.url}`:` ${e.name} [skipped: ${e.reason}]`)];return c.diagnostics.length>0&&d.push(``,`Diagnostics:`,HM(c.diagnostics)),CM(d.join(`
|
|
1879
1879
|
`)+`
|
|
1880
1880
|
`)}async function zM(e,t,n,r){if(w(e))return CM(`usage: plugin validate <path|repo>
|
|
1881
1881
|
`);let i=wM(`validate`,e);if(!(`ok`in i))return i;if(i.positionals.length<1)return q(`plugin validate: expected <path|repo>`);let a=await DM(n),o=await OM(i.positionals[0],t,a);if(o.kind===`error`)return q(`plugin validate: ${o.message}`);let s,c=null;if(o.kind===`github`){if(!n.fetch)return q(`plugin validate: GitHub sources are unavailable (no network fetch configured)`);c=`${r}/.plugin-validate/${AM(o.ref).split(`/`).pop()}`;let e=await jM(o.ref,c,a,n.fetch);if(e)return q(`plugin validate: ${e}`);s=c}else s=o.root;let{loadPluginFromDirectory:l}=await import(`./loader-Dw-TPPKt.js`),u;try{u=await l(a,s)}finally{c&&await MM(a,c)}if(!u.ok)return{stdout:``,stderr:`plugin validate: REJECTED\n${HM(u.diagnostics)}\n`,exitCode:1};let{plugin:d}=u,f=d.mcp.servers.filter(e=>e.status===`supported`).length,p=[`plugin validate: OK — "${d.manifest.name}"${d.manifest.version?` v${d.manifest.version}`:``}`,` skills: ${d.skills.length}`,` mcp servers: ${f} supported, ${d.mcp.servers.length-f} skipped (mcp.json ${d.mcp.status})`];return u.diagnostics.length>0&&p.push(`Diagnostics:`,HM(u.diagnostics)),CM(p.join(`
|
|
1882
1882
|
`)+`
|
|
1883
1883
|
`)}async function BM(e,t){if(w(e))return CM(`usage: plugin remove <name>
|
|
1884
|
-
`);let n=wM(`remove`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return q(`plugin remove: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i,deleteInstalledPlugin:a}=await import(`./store-
|
|
1884
|
+
`);let n=wM(`remove`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return q(`plugin remove: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i,deleteInstalledPlugin:a}=await import(`./store-B0SHnRWQ.js`),o=await i(r,t.fs);if(!o)return q(`plugin remove: no installed plugin named "${r}"`);let s=0;if(o.mcpServerNames&&o.mcpServerNames.length>0){let{deleteServer:e,getServer:n}=await import(`./store-VxOSzjl-.js`).then(e=>e.r);for(let i of o.mcpServerNames)(await n(i,t.fs))?.pluginOrigin===r&&await e(i,t.fs)&&(s+=1)}await a(r,t.fs);let c=o.root.startsWith(`${SM}/`);return c&&await MM(await DM(t),o.root),CM([`Removed agent plugin "${r}"`,` registry: removed`,` mcp servers: ${s} removed`,c?` files: removed (${o.root})`:` files: left in place (${o.root})`].join(`
|
|
1885
1885
|
`)+`
|
|
1886
1886
|
`)}function VM(e,t){let n=t.startsWith(`/`)?t:`${e.replace(/\/$/,``)}/${t}`,r=[];for(let e of n.split(`/`))e!==``&&e!==`.`&&(e===`..`?r.pop():r.push(e));return`/${r.join(`/`)}`}function HM(e){return e.map(e=>` ${e.level===`error`?`error`:`warn `} [${e.component}] ${e.message}`).join(`
|
|
1887
1887
|
`)}const UM=[`pid`,`ppid`,`kind`,`stat`,`start`,`scoop`,`command`],WM=[`pid`,`ppid`,`stat`,`start`,`scoop`,`command`],GM={running:`R`,pending:`S`,exited:`Z`,killed:`K`},KM=[`-a`,`-A`,`-e`,`--all`,`-T`,`--tree`],qM=[`-o`,`--columns`];function JM(e={}){return S(`ps`,async t=>{if(w(t,{valueFlags:qM}))return cN();let n=e.processManager??YM();if(!n)return{stdout:``,stderr:`ps: no process manager available in this runtime
|
|
@@ -2088,7 +2088,7 @@ Limits and lifetime:
|
|
|
2088
2088
|
`,exitCode:1};if(e.ttlMs!==void 0&&e.maxTabs!==void 0)return{stdout:``,stderr:`serve: --ttl cannot be combined with --max-tabs
|
|
2089
2089
|
`,exitCode:1}}async function xF(e,t,n){if(e.ttlMs!==void 0){if(!t)throw Error(`persistent snapshot filesystem unavailable`);return pF(t,n)}}async function SF(e,t,n,r){if(e.length===0||e.includes(`--help`)||e.includes(`-h`))return ZP();let i=rF(e);if(i.error)return{stdout:``,stderr:i.error,exitCode:1};let a=await yF(i);if(a)return a;if(!i.directory)return ZP();let o=bF(i);if(o)return o;let s=await iF(i.directory,i.entry,t.fs,t.cwd);if(aF(s))return s;let{fullDirectory:c,entryPath:l}=s,u;try{u=await xF(i,r,c)}catch(e){return{stdout:``,stderr:`serve: ${e instanceof Error?e.message:String(e)}\n`,exitCode:1}}let d=i.project?`serve: --project is obsolete; ignored (root-absolute paths work natively under unified preview)
|
|
2090
2090
|
`:``,f=await _F(!i.noBridge&&i.bridge,d);return f.ok?vF(i,c,l,f.webhookId,d,u,n):f.result}function CF(e,t){return S(`serve`,(n,r)=>SF(n,r,e,t))}const wF=`usage: session export [--id <id>] [--output <path>]
|
|
2091
|
-
`;function TF(e){if(e.includes(`\0`))return{ok:!1,reason:`path must not contain NUL bytes`};if(e.includes(`\\`))return{ok:!1,reason:`path must not contain backslashes`};let t=e.split(`/`);for(let e of t)if(e===`..`)return{ok:!1,reason:`path must not contain ".."/traversal segments`};return{ok:!0}}function EF(e){let t=null,n=null,r=e.slice(1);for(let e=0;e<r.length;e++){let i=r[e];if(i===`--id`){if(t!==null)return{ok:!1,stderr:`session export: duplicate flag --id\n${wF}`};let n=r[e+1];if(!n||n.startsWith(`-`))return{ok:!1,stderr:`session export: --id requires a value\n${wF}`};t=n,e++}else if(i===`--output`){if(n!==null)return{ok:!1,stderr:`session export: duplicate flag --output\n${wF}`};let t=r[e+1];if(!t||t.startsWith(`-`))return{ok:!1,stderr:`session export: --output requires a path\n${wF}`};n=t,e++}else if(i.startsWith(`-`))return{ok:!1,stderr:`session export: unknown flag ${i}\n${wF}`};else return{ok:!1,stderr:`session export: unexpected argument ${JSON.stringify(i)}\n${wF}`}}return{ok:!0,args:{sessionId:t,outputPath:n}}}async function DF(e){let t=[],n=0;for await(let r of e.chunks)t.push(r),n+=r.byteLength;let r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.byteLength;let a=await e.completion;if(a.byteLength!==n||Dt(r)!==a.sha256)throw new Oa(`transfer-corrupt`);return r}async function OF(e,t){let n=EF(e);if(!n.ok)return{stdout:``,stderr:n.stderr,exitCode:1};let{sessionId:r,outputPath:i}=n.args;if(i!==null){let e=TF(i);if(!e.ok)return{stdout:``,stderr:`session export: --output ${e.reason}\n${wF}`,exitCode:1}}let a=r==null?{kind:`active`}:{kind:`frozen`,sessionId:r};try{let e=await ms().export(a,{}),n=await DF(e),r=i??`/workspace/${e.filename}`;return await t.fs.writeFile(r,n),{stdout:`exported ${r}\n`,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`session export: ${e instanceof Oa?e.code:e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function kF(){return S(`session`,async(e,t)=>{if(e[0]===`export`&&!w(e))return OF(e,t);let{dispatchSessionMemoryAware:n}=await import(`./session-command-memory-
|
|
2091
|
+
`;function TF(e){if(e.includes(`\0`))return{ok:!1,reason:`path must not contain NUL bytes`};if(e.includes(`\\`))return{ok:!1,reason:`path must not contain backslashes`};let t=e.split(`/`);for(let e of t)if(e===`..`)return{ok:!1,reason:`path must not contain ".."/traversal segments`};return{ok:!0}}function EF(e){let t=null,n=null,r=e.slice(1);for(let e=0;e<r.length;e++){let i=r[e];if(i===`--id`){if(t!==null)return{ok:!1,stderr:`session export: duplicate flag --id\n${wF}`};let n=r[e+1];if(!n||n.startsWith(`-`))return{ok:!1,stderr:`session export: --id requires a value\n${wF}`};t=n,e++}else if(i===`--output`){if(n!==null)return{ok:!1,stderr:`session export: duplicate flag --output\n${wF}`};let t=r[e+1];if(!t||t.startsWith(`-`))return{ok:!1,stderr:`session export: --output requires a path\n${wF}`};n=t,e++}else if(i.startsWith(`-`))return{ok:!1,stderr:`session export: unknown flag ${i}\n${wF}`};else return{ok:!1,stderr:`session export: unexpected argument ${JSON.stringify(i)}\n${wF}`}}return{ok:!0,args:{sessionId:t,outputPath:n}}}async function DF(e){let t=[],n=0;for await(let r of e.chunks)t.push(r),n+=r.byteLength;let r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.byteLength;let a=await e.completion;if(a.byteLength!==n||Dt(r)!==a.sha256)throw new Oa(`transfer-corrupt`);return r}async function OF(e,t){let n=EF(e);if(!n.ok)return{stdout:``,stderr:n.stderr,exitCode:1};let{sessionId:r,outputPath:i}=n.args;if(i!==null){let e=TF(i);if(!e.ok)return{stdout:``,stderr:`session export: --output ${e.reason}\n${wF}`,exitCode:1}}let a=r==null?{kind:`active`}:{kind:`frozen`,sessionId:r};try{let e=await ms().export(a,{}),n=await DF(e),r=i??`/workspace/${e.filename}`;return await t.fs.writeFile(r,n),{stdout:`exported ${r}\n`,stderr:``,exitCode:0}}catch(e){return{stdout:``,stderr:`session export: ${e instanceof Oa?e.code:e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function kF(){return S(`session`,async(e,t)=>{if(e[0]===`export`&&!w(e))return OF(e,t);let{dispatchSessionMemoryAware:n}=await import(`./session-command-memory-MecK0_iM.js`);return n(e,t,wF)})}function AF(){return S(`slicc`,async(e,t)=>{let{runSlicc:n}=await import(`./run-cvQKad0O.js`);return await n(e,t)})}const jF=`leader`;function MF(){try{let e=globalThis.localStorage?.getItem(`slicc.leaderSprinkleInstances`);if(e)return JSON.parse(e)}catch{}return[]}function NF(e){return+!!e.leader+e.followers.length}function PF(){return{stdout:`usage: sprinkle <subcommand> [args]
|
|
2092
2092
|
|
|
2093
2093
|
list [--runtime <id>] List sprinkles + an instance line per runtime
|
|
2094
2094
|
open <name> Open a sprinkle by name
|