sliccy 6.169.3 → 6.169.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/ui/.vite/manifest.json +178 -178
- package/dist/ui/assets/{account-store-WEH3Mb6R.js → account-store-BxxO__4E.js} +1 -1
- package/dist/ui/assets/{account-store-BZRm0ftR.js → account-store-DYRmFaT1.js} +1 -1
- package/dist/ui/assets/{adobe-BjvVIPw1.js → adobe-D1E1ldY0.js} +1 -1
- package/dist/ui/assets/{adobe-D0uYDlhB.js → adobe-D1ujs4oQ.js} +1 -1
- package/dist/ui/assets/{agent-panels-DuPBqXhJ.js → agent-panels-BH_nPgbv.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-DsC_gtvt.js → almost-bash-shell-headless-DOItOGUT.js} +31 -31
- package/dist/ui/assets/{apply-layout-BphyPton.js → apply-layout-DZmnT2Od.js} +1 -1
- package/dist/ui/assets/{apps-D-Fh4Yb3.js → apps-BPjJyue-.js} +1 -1
- package/dist/ui/assets/{azure-openai-Cst8lnR-.js → azure-openai-1l5btEvT.js} +1 -1
- package/dist/ui/assets/{azure-openai-CwincCwu.js → azure-openai-CdnJkYvQ.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-DxCAZKWg.js → backend-hostfs-BkSu1MPd.js} +1 -1
- package/dist/ui/assets/{cdp-B9BmJafx.js → cdp-hHByS8f8.js} +1 -1
- package/dist/ui/assets/{cerebras-Cc4lcPZx.js → cerebras-BGv0G_VG.js} +1 -1
- package/dist/ui/assets/{cerebras-Bg0zKaeR.js → cerebras-CFIE0-SS.js} +1 -1
- package/dist/ui/assets/{composer-speech-B37tfZE3.js → composer-speech-Dzc9A1gD.js} +1 -1
- package/dist/ui/assets/{connect-surface-598qUurq.js → connect-surface-CmkLEren.js} +1 -1
- package/dist/ui/assets/{directed-approval-BqqlwBOG.js → directed-approval-CivsWMqN.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-xUlptlQX.js → ensure-speech-assets-msxMcSSE.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-CghxZN6K.js → frozen-archive-writer-C7ojkWmx.js} +1 -1
- package/dist/ui/assets/{fs-6UJrOa70.js → fs-MRixwWOW.js} +1 -1
- package/dist/ui/assets/{fs-C6sUA0mD.js → fs-_tHgBVaI.js} +2 -2
- package/dist/ui/assets/{gelatiere-store-oUaMTYvB.js → gelatiere-store-BUFU_okz.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-BRalUtud.js → gelatiere-unit-DutsxznB.js} +1 -1
- package/dist/ui/assets/{github-826B0K_W.js → github-BW8_yB5A.js} +2 -2
- package/dist/ui/assets/{github-CwRp3q0D.js → github-CFDSFPZF.js} +1 -1
- package/dist/ui/assets/{github-auth-DwZWeXTM.js → github-auth-CKAjIBeh.js} +1 -1
- package/dist/ui/assets/{github-copilot-Dch5Y2PO.js → github-copilot-CAuLubVY.js} +1 -1
- package/dist/ui/assets/{github-copilot-DP0ZEsR6.js → github-copilot-DsgHoQdH.js} +1 -1
- package/dist/ui/assets/{github-install-BOfgY9iA.js → github-install-TUO-O3z7.js} +1 -1
- package/dist/ui/assets/{github-zip-cIVZtH_N.js → github-zip-sJ90ptuX.js} +1 -1
- package/dist/ui/assets/{hear-D2YMShJM.js → hear-BaDQDxuG.js} +1 -1
- package/dist/ui/assets/{help-BB1WSWiM.js → help-DGPJ7J8S.js} +1 -1
- package/dist/ui/assets/{installer-DRr77YPx.js → installer-CyGwaVEH.js} +1 -1
- package/dist/ui/assets/isomorphic-git-C3lNgE6Y.js +69 -0
- package/dist/ui/assets/isomorphic-git-r9mnHMnp.js +86 -0
- package/dist/ui/assets/{js-realm-worker-CoSJpqSK.js → js-realm-worker-Bu9rzz1y.js} +1 -1
- package/dist/ui/assets/{jsh-executor-4Eix4JPS.js → jsh-executor-Byc_CbYy.js} +2 -2
- package/dist/ui/assets/{kernel-worker-BCdaQtpV.js → kernel-worker-CN7hm2Lb.js} +9 -9
- package/dist/ui/assets/{lick-ws-bridge-CJaH1Urh.js → lick-ws-bridge-BN7P6FP_.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-HuqiT_FV.js → lick-ws-bridge-nrJiWCJP.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-LLuRT8Y6.js → live-session-snapshot-DHyllwI0.js} +1 -1
- package/dist/ui/assets/{local-llm-qKNi4VlH.js → local-llm-0xPR3YSO.js} +1 -1
- package/dist/ui/assets/{local-llm-BzKw6ZQ2.js → local-llm-ByxMJPV1.js} +1 -1
- package/dist/ui/assets/{main-DiX-exZ1.js → main-C4P-HJe4.js} +3 -3
- package/dist/ui/assets/{main-cherry-p_EckDbc.js → main-cherry-DWAb4trc.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-C23NWK-N.js → memory-curation-seam-CCAgCJGZ.js} +1 -1
- package/dist/ui/assets/{memory-health-BCf8emKe.js → memory-health-Cd_CUoSg.js} +1 -1
- package/dist/ui/assets/memory-v2-flag-cN3RMof2.js +1 -0
- package/dist/ui/assets/{memory-write-execute-BDqzjNYe.js → memory-write-execute-IRx48Xx-.js} +1 -1
- package/dist/ui/assets/{mount-DFyqW7Xs.js → mount-DQTm9Hcx.js} +1 -1
- package/dist/ui/assets/{mount-BeWLVMVu.js → mount-DkZpSmjf.js} +3 -3
- package/dist/ui/assets/{mv-BE_lEtyG.js → mv-ohCkaQgo.js} +1 -1
- package/dist/ui/assets/{new-session-CyEDzxpN.js → new-session-JgGPdNy4.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-DtQVqCYR.js → oauth-bootstrap-nz1m29O6.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-OnX7HwLK.js → onboarding-orchestrator-c4fnVHlP.js} +1 -1
- package/dist/ui/assets/{openai-codex-1Dv0UPoR.js → openai-codex-DUfP8Bpu.js} +1 -1
- package/dist/ui/assets/{openai-codex-MC7TGA6C.js → openai-codex-DZd_rq5R.js} +1 -1
- package/dist/ui/assets/{openrouter-CIRjd5eq.js → openrouter-D9SniWDI.js} +1 -1
- package/dist/ui/assets/{openrouter-Bt9f3_Uv.js → openrouter-DfMu7gbd.js} +1 -1
- package/dist/ui/assets/{openrouter-free-BnZzQoqs.js → openrouter-free-DCIv028R.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DdGr-0kx.js → openrouter-free-De2tIIUY.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Bsthz3oL.js → openrouter-oauth-B1kGwOCr.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-BLBo1rY_.js → openrouter-oauth-D2SIH8Bd.js} +1 -1
- package/dist/ui/assets/{opfs-mount-rZKzKjka.js → opfs-mount-D1aitvgt.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BbccoVQP.js → panel-rpc-handlers-OuYmOwWl.js} +2 -2
- package/dist/ui/assets/{panelize-shell-Cgn-KjdE.js → panelize-shell-Cq1O-Cxg.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-DEMXN5cK.js → pi-edit-execution-B84Qas6v.js} +1 -1
- package/dist/ui/assets/{provider-Cuth-hI7.js → provider-0U_dQCSg.js} +1 -1
- package/dist/ui/assets/{provider-DtYtczKF.js → provider-Bq5PnK_6.js} +2 -2
- package/dist/ui/assets/{provider-settings-CP0rD-xo.js → provider-settings-TayDhser.js} +1 -1
- package/dist/ui/assets/provider-store-access-CGafaQuU.js +1 -0
- package/dist/ui/assets/provider-store-access-DhpLsRi1.js +1 -0
- package/dist/ui/assets/{providers-Djf6LQVK.js → providers-DdRnizG6.js} +2 -2
- package/dist/ui/assets/{providers-VTUgzqSf.js → providers-FzN1gZBm.js} +1 -1
- package/dist/ui/assets/{quick-llm-D5ULRtUi.js → quick-llm-CYUyPOds.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-Bc9eZN3t.js → realm-inprocess-B3QwR5v6.js} +1 -1
- package/dist/ui/assets/{recovery-screen-CMMrHySr.js → recovery-screen-C_H59RLX.js} +1 -1
- package/dist/ui/assets/{restore-sDEy7SXV.js → restore-owDPVAIr.js} +1 -1
- package/dist/ui/assets/{run-DwWgjuws.js → run-BdDImUoG.js} +2 -2
- package/dist/ui/assets/{run-BTv1S0WG.js → run-CJjv02IN.js} +1 -1
- package/dist/ui/assets/{run-dne773bd.js → run-DUvX7niM.js} +1 -1
- package/dist/ui/assets/{run-DAVL1J8o.js → run-DVwTsBN0.js} +2 -2
- package/dist/ui/assets/{run-CdlTb8kS.js → run-DtZxbiwE.js} +2 -2
- package/dist/ui/assets/{run-a9syGGdB.js → run-HrV-eacV.js} +2 -2
- package/dist/ui/assets/{session-command-memory-U2coqmKd.js → session-command-memory-CUv5Wqna.js} +2 -2
- package/dist/ui/assets/{session-jsonl-DffpXh18.js → session-jsonl-BQLRcUON.js} +1 -1
- package/dist/ui/assets/{session-jsonl-qAwXizp3.js → session-jsonl-CvZPkL1e.js} +1 -1
- package/dist/ui/assets/{session-search-index-DcTrLxqn.js → session-search-index-DgRgH5gK.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-DngzVyW2.js → setup-feature-flags-remote-DKCkgEgO.js} +1 -1
- package/dist/ui/assets/{signed-fetch-CsngCd2r.js → signed-fetch-CRbjRIz-.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-JV6sorXF.js → silent-renew-backoff-BnPqIrAn.js} +1 -1
- package/dist/ui/assets/slicc-version-D9AJk7K9.js +1 -0
- package/dist/ui/assets/{snapshot-DbcG55_l.js → snapshot-Dxp0PQCX.js} +1 -1
- package/dist/ui/assets/{snapshot-features-Q8fxxw8t.js → snapshot-features-YSQlnH7H.js} +1 -1
- package/dist/ui/assets/{soundscape-BequuhM-.js → soundscape-Cc68KS6q.js} +1 -1
- package/dist/ui/assets/{speak-Bhvglc07.js → speak-BYg_6-yK.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-C1l22ho-.js → sprinkle-manager-DtYcB8XU.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-TxZho7O8.js → sprinkle-renderer-D_q42V6j.js} +1 -1
- package/dist/ui/assets/{state-CT4GTIKd.js → state-DU-PXpfH.js} +1 -1
- package/dist/ui/assets/{store-CMWgKiX5.js → store-BFiQRp1I.js} +1 -1
- package/dist/ui/assets/{store-CmgCsEO0.js → store-BOb9e9JK.js} +1 -1
- package/dist/ui/assets/{sudo-yd8ac8U2.js → sudo-rg7eGOLO.js} +1 -1
- package/dist/ui/assets/{supervisor-6Tr4-kLJ.js → supervisor-BE3Q5f9F.js} +1 -1
- package/dist/ui/assets/{sync-dialog-JdmeTiWw.js → sync-dialog-C-RKGC8S.js} +1 -1
- package/dist/ui/assets/{transformers-env-BsE2-4kO.js → transformers-env-Bghq5wjQ.js} +1 -1
- package/dist/ui/assets/{tray-leader-D6MWAnWN.js → tray-leader-gLaa4wv6.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-B9QOv3AE.js → tray-leave-runtime-C3UygfQA.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-DzusfEfP.js → tray-sidecar-7682nEuA.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-TK7gNMca.js → upgrade-detection-BaE6yZn5.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-BcNCF_bH.js → upskill-lick-skip-TW4_BwQm.js} +1 -1
- package/dist/ui/assets/{voice-reply-BnrYd_ar.js → voice-reply-BzU7PskI.js} +1 -1
- package/dist/ui/assets/{wc-attach-199s_236.js → wc-attach-BGjCNUWO.js} +2 -2
- package/dist/ui/assets/{wc-browser-D4lXmzTx.js → wc-browser-KU6RPEZC.js} +1 -1
- package/dist/ui/assets/{wc-computers-ChHan-f_.js → wc-computers-C7wAmKE4.js} +1 -1
- package/dist/ui/assets/{wc-detached-C7OHts3P.js → wc-detached-BlCldzB4.js} +1 -1
- package/dist/ui/assets/{wc-extension-B_4pYASM.js → wc-extension-GPWZndtQ.js} +2 -2
- package/dist/ui/assets/{wc-follower-iDCvGVPA.js → wc-follower---oj8LFX.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-D3wzrXO2.js → wc-follower-oauth-BkuJe6LE.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-DNczb8-F.js → wc-gelatiere-BriJhff2.js} +1 -1
- package/dist/ui/assets/{wc-live-CeYr3mhq.js → wc-live-hd3lKSV4.js} +5 -5
- package/dist/ui/assets/{wc-nav-lgrpO6Hy.js → wc-nav-BkNMv3gW.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-DfseRP4O.js → wc-onboarding-lWORVK0k.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-UltQSrgO.js → wc-placeholder-D0BipkFq.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-B4CZbiFB.js → wc-secret-request-CxkyHjfe.js} +1 -1
- package/dist/ui/assets/{wc-settings-HvcyjEBE.js → wc-settings-IHRpMQd1.js} +3 -3
- package/dist/ui/assets/{wc-shell-CZrLJ6qk.js → wc-shell-DQab5EI0.js} +4 -4
- package/dist/ui/assets/{wc-shortcut-config-VJHYWKJs.js → wc-shortcut-config-BOL2DfP9.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-C3_mbV8i.js → wc-sprinkles-wZbB8zRr.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-DxO_dIRi.js → wc-transcript-export-BkFPfwzn.js} +2 -2
- package/dist/ui/assets/{wc-tray-DLtchQJK.js → wc-tray-C0X1mpAO.js} +4 -4
- package/dist/ui/assets/welcome-detection-CzNfc33N.js +1 -0
- package/dist/ui/assets/{whisper-session-CWBgprbN.js → whisper-session-DmKeJ2we.js} +2 -2
- package/dist/ui/assets/{xai-grok-fKBUbqX-.js → xai-grok-Tyy0d-EU.js} +1 -1
- package/dist/ui/assets/{xai-grok-DIVCjt6B.js → xai-grok-odpzas31.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/isomorphic-git-B9eVtfwq.js +0 -69
- package/dist/ui/assets/isomorphic-git-DXMEKpHT.js +0 -86
- package/dist/ui/assets/memory-v2-flag-Bms64n4r.js +0 -1
- package/dist/ui/assets/provider-store-access-B3wkbna_.js +0 -1
- package/dist/ui/assets/provider-store-access-CEqDbGQH.js +0 -1
- package/dist/ui/assets/slicc-version-DXjL5gdq.js +0 -1
- package/dist/ui/assets/welcome-detection-Bj8GsFej.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import{a as t,i as n,n as r,r as i,t as a}from"./snapshot-DbcG55_l.js";import{n as o,r as s}from"./panel-rpc-BPwAqRch.js";import{t as c}from"./providers-VTUgzqSf.js";import{r as l,t as u}from"./base64-BPBW1Gzr.js";import{n as d}from"./bridge-protocol-31SWTdS5.js";import{a as f,n as p,o as m,s as h,t as g}from"./handoff-link-B3It6xQY.js";import{d as _,f as v,i as ee,u as te}from"./account-store-WEH3Mb6R.js";import{a as ne,l as re,n as ie,o as ae}from"./proxied-fetch-CPL8wJM2.js";import{t as oe}from"./runtime-env-DadgceZk.js";import{t as se}from"./slugify-BYJ6QVAt.js";import{n as ce,t as le}from"./host-command-XUdketMY.js";import{r as ue}from"./binary-cache-bSOhqXB1.js";import{i as de,n as fe,r as pe}from"./fetch-body-CuwTaJC_.js";import{o as me,t as he}from"./api-endpoint-3qEcn7BY.js";import{t as ge}from"./compat-uEPf6-XW.js";import{a as _e,i as ve}from"./core-w0-0FXns.js";import{n as ye,t as be}from"./mime-types-D7IV6i7k.js";import{t as xe}from"./secrets-bridge-client-CeK7HpDf.js";import{a as Se,i as Ce,n as we,r as Te}from"./tool-ui-DRnUkp2g.js";import{a as Ee,i as De,n as y,t as b}from"./path-utils-DNJG-zQf.js";import{n as Oe,r as ke,t as Ae}from"./merge-file-core-VJlzucJY.js";import{r as je}from"./workspace-mode-D0kUKBVS.js";import{n as Me,t as Ne}from"./thinking-level-5x0UAu9N.js";import{n as Pe,t as Fe}from"./types-D8gIX-W-.js";import{i as Ie}from"./mount-index-CQfmUPuZ.js";import{a as Le,i as Re,n as ze,o as Be,s as Ve,t as He}from"./signed-fetch-CsngCd2r.js";import{o as Ue}from"./mount-table-store-DrF_Ifaz.js";import{t as We}from"./remote-cache-BE5T1-53.js";import{n as Ge}from"./fs-6UJrOa70.js";import{a as Ke}from"./tray-leader-status-CpkFr6n7.js";import{n as qe,t as Je}from"./slicc-version-DXjL5gdq.js";import{a as Ye,i as Xe,o as Ze,r as x,t as Qe}from"./browser-eoO4vY7w.js";import{t as S}from"./subcommand-flags-BZi7j78Q.js";import{n as $e,r as et,t as C}from"./subcommand-help-CgO7wRS5.js";import{n as tt}from"./cost-command-BSMq-p2s.js";import{d as nt,g as rt,i as it,n as at,o as ot}from"./sudoers-BdBYQPUn.js";import{n as st,r as ct,t as lt}from"./approval-timeout-BQ29Z0gf.js";import{a as ut,c as dt,i as ft,l as pt,n as mt,o as ht,r as gt,t as _t}from"./types-BfwydWt7.js";import{n as w,t as vt}from"./boundary-Cp9c_bPu.js";import"./rest-paths-Dia19u9P.js";import{t as yt}from"./html-B_Hg2WOy.js";import{n as bt}from"./llm-session-id-BZyXP_j2.js";import{t as xt}from"./buffer-polyfill-BccMjOKj.js";import{i as St,o as Ct}from"./browser-DuyhpHbR.js";import{_ as wt,b as Tt,c as Et,d as Dt,f as Ot,g as kt,h as At,l as jt,m as Mt,n as Nt,o as Pt,p as Ft,s as It,t as Lt,u as Rt,v as zt,x as Bt,y as Vt}from"./jsh-executor-4Eix4JPS.js";import{t as Ht}from"./buffer-B5d1xHaH.js";import{A as Ut,B as T,C as Wt,D as E,E as Gt,F as Kt,G as qt,H as D,I as O,J as Jt,K as Yt,L as Xt,M as Zt,N as Qt,O as $t,P as en,R as tn,S as nn,T as rn,U as an,V as on,W as sn,Y as cn,_ as ln,a as un,b as dn,c as fn,d as pn,f as mn,g as hn,h as gn,i as _n,j as vn,k as yn,l as bn,m as xn,n as Sn,o as Cn,p as k,q as wn,r as Tn,s as En,t as Dn,u as On,v as kn,w as An,x as jn,y as Mn,z as Nn}from"./isomorphic-git-DXMEKpHT.js";import"./global-db-DJXlpNui.js";import{S as Pn,_ as Fn,a as In,b as Ln,c as Rn,d as zn,f as Bn,g as Vn,h as Hn,i as Un,l as Wn,n as Gn,o as Kn,p as qn,r as Jn,s as Yn,t as Xn,u as Zn,v as A,x as j,y as Qn}from"./state-CT4GTIKd.js";import{a as $n,i as er,r as tr,t as nr}from"./git-config-Bdgu8kD2.js";import{i as rr,n as ir,r as ar}from"./jsh-discovery-D3Gk1cKA.js";import{A as or,C as sr,a as cr,b as lr,c as ur,d as dr,f as fr,h as pr,i as mr,j as hr,l as gr,m as _r,n as vr,o as yr,p as br,r as xr,s as Sr,t as M,u as Cr,v as wr,y as Tr}from"./shared-C_68vn79.js";import{B as Er,F as Dr,G as Or,H as kr,J as Ar,K as jr,L as Mr,N as Nr,P as Pr,U as Fr,V as Ir,W as Lr,X as Rr,Y as zr,Z as Br,q as Vr,z as Hr}from"./sync-sab-wire-CC30v4TL.js";import{n as Ur,t as Wr}from"./esbuild-wasm-DS_YG2EY.js";import{n as Gr}from"./wasm-compiler-Ct7QZURL.js";import{a as Kr,o as qr,s as Jr,t as Yr}from"./usb-device-registry-DFzxaOky.js";import{a as N,i as Xr,r as Zr,t as Qr}from"./just-bash-compat-B-SPHuh_.js";import{i as $r,r as ei,t as ti}from"./script-catalog-CgT8L-OG.js";import{a as ni,c as ri,o as ii,s as ai,t as oi}from"./types-Dzr0qYl3.js";import{a as si,c as ci,d as li,f as ui,n as di,r as fi,u as pi}from"./github-zip-cIVZtH_N.js";import{i as mi,t as hi}from"./github-auth-DwZWeXTM.js";import{a as gi,i as _i,o as vi,r as yi,t as bi}from"./provenance-DdmsQ3Nr.js";import{a as xi,c as Si,i as Ci,n as wi,o as Ti,r as Ei,s as Di}from"./github-install-BOfgY9iA.js";import{n as Oi,t as ki}from"./magick-wasm-DCNZhAyd.js";import{i as Ai,n as ji,r as Mi,t as Ni}from"./pdf-raster-BWk6ezTX.js";import{n as Pi}from"./lick-target-env-8JxfVcIV.js";import{t as Fi}from"./tmpdir-env-ate4iNcK.js";import{a as Ii,c as Li,d as Ri,f as zi,i as Bi,l as Vi,n as Hi,o as Ui,p as Wi,r as Gi,s as Ki,t as qi,u as Ji}from"./installer-DRr77YPx.js";import{t as Yi}from"./ffmpeg-wasm-B77gfnB_.js";import{t as Xi}from"./local-llm-qKNi4VlH.js";import{t as Zi}from"./client-_vVqanZy.js";import{t as Qi}from"./redirect-uri-D2aDPCyB.js";import{a as $i,c as ea,i as ta,o as na,r as ra,s as ia}from"./v86-vm-DCm7zA2r.js";import{n as aa,r as oa}from"./lick-urls-CgPiVwD-.js";let sa=null;function ca(e){sa=e!==null&&Number.isFinite(e)&&e>0?e:null}function la(){if(sa!==null)return sa;let e=globalThis.performance?.timeOrigin;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Date.now()}new URL(d).hostname;const ua=/^([0-9a-f]{32})--(?:[0-9a-f]{8}-)?([0-9a-f]+)$/i;function da(e){let t;try{t=new URL(e.includes(`://`)?e:`https://${e}`).hostname}catch{return null}let n=ua.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 fa(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 pa(e,t){return e.some(e=>fa(e,t))}const ma=`slicc-transcript`,ha=[`canonical-agent-history-unavailable`,`tool-data-may-be-truncated`,`model-metadata-unavailable`,`scoop-history-unavailable`,`attachment-file-missing`,`attachment-association-unavailable`,`complete-snapshot-unavailable`],ga=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 _a(e){return ga.has(e.replace(/\/\d+(?=\/|$)/g,`/*`))}var va=class extends Error{code;detail;constructor(e,t){super(t?`${e}: ${t}`:e),this.code=e,this.detail=t,this.name=`TranscriptExportError`}};const ya=new Set(ha),ba=/^[0-9a-fA-F]{64}$/,xa=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Sa(e){return typeof e==`string`&&ba.test(e)}function Ca(e){return xa.test(e)&&Number.isFinite(Date.parse(e))}function wa(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 Ta(e,t,n){return typeof e!=`string`||!t.includes(e)?{ok:!1,error:wa(n,t)}:{ok:!0}}function Ea(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 Da(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 Oa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Ta(e.type,[`text`,`tool-call`,`attachment-ref`],`${t}.type`);return n.ok?Da(e,t):n}function ka(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 Aa(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 ja(e,t){let n=ka(e,t);if(!n.ok)return n;let r=e.cost;return P(r)?Aa(r,`${t}.cost`):{ok:!1,error:`${t}.cost must be a non-null object`}}function Ma(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`?Ca(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 Na(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 Pa(e,t){let n=e.usage;return n===void 0?{ok:!0}:P(n)?ja(n,`${t}.usage`):{ok:!1,error:`${t}.usage must be a non-null object`}}function Fa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Ta(e.role,[`user`,`assistant`,`tool-result`],`${t}.role`);if(!n.ok)return n;if(e.role===`tool-result`){let n=Na(e,t);if(!n.ok)return n}let r=Ma(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=Ea(i,Oa,`${t}.content`);return a.ok?Pa(e,t):a}function Ia(e,t){if(!P(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=Ta(e.kind,[`cone`,`scoop`],`${t}.kind`);if(!n.ok)return n;let r=e.messages;return Array.isArray(r)?Ea(r,Fa,`${t}.messages`):{ok:!1,error:`${t}.messages must be an array`}}function La(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 Ra(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`}:Sa(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 za=[`attachment-file-missing`,`attachment-association-unavailable`];function Ba(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?r===``?i===0?Ta(e.missingReason,za,`${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 Va(e,t){return e.present?Ra(e,t):Ba(e,t)}function Ha(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=La(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=Ta(e.handling,[`text-redacted`,`binary-unchanged`],`${t}.handling`);return r.ok?Va(e,t):r}function Ua(e,t){let n=Ta(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 Wa(e,t){if(!P(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=Ta(e.detector,[`known-secret`,`credential-pattern`,`pre-obfuscated`],`${t}.detector`);if(!n.ok)return n;let r=e.target;return P(r)?Ua(r,`${t}.target`):{ok:!1,error:`${t}.target must be a non-null object`}}function Ga(e,t){return P(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 Ka(e,t){return typeof e!=`string`||!ya.has(e)?{ok:!1,error:`${t} is not a valid completeness reason`}:{ok:!0}}function qa(e){if(!P(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 P(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 Ja(e){if(!P(e))return{ok:!1,error:`session.completeness must be a non-null object`};let t=Ta(e.status,[`complete`,`partial`],`session.completeness.status`);return t.ok?Array.isArray(e.missing)?Ea(e.missing,Ka,`session.completeness.missing`):{ok:!1,error:`session.completeness.missing must be an array`}:t}function Ya(e){if(!P(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=Ta(e.state,[`active`,`frozen`],`session.state`);return t.ok?Ja(e.completeness):t}function Xa(e){if(!P(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(!P(e.redactionCounts))return{ok:!1,error:`privacy.redactionCounts must be a non-null object`};let n=e.redactions;return Array.isArray(n)?Ea(n,Wa,`privacy.redactions`):{ok:!1,error:`privacy.redactions must be an array`}}function Za(e){let t=e.conversations;if(!Array.isArray(t))return{ok:!1,error:`conversations must be an array`};let n=Ea(t,Ia,`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=Ea(r,Ga,`delegations`);if(!i.ok)return i;let a=e.attachments;return Array.isArray(a)?Ea(a,Ha,`attachments`):{ok:!1,error:`attachments must be an array`}}function Qa(e){let t=new Set,n=new Set;for(let r of e){if(!P(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(!(!P(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 $a(e){for(let t of e){if(!P(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(!P(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 eo(e){let t=[];for(let n of e){if(!P(n))continue;let e=n.content;if(Array.isArray(e))for(let n of e)P(n)&&n.type===`tool-call`&&typeof n.id==`string`&&t.push(n.id)}return t}function to(e){let t=new Set;for(let n of e){if(!P(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of eo(e))t.add(n)}return t}function no(e,t){for(let n of e){if(!P(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!P(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 ro(e){return no(e,to(e))}function io(e,t){for(let n of e){if(!P(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 ao(e,t){for(let n of e){if(!P(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!P(n))continue;let e=n.content;if(!Array.isArray(e))continue;let r=io(e,t);if(!r.ok)return r}}return{ok:!0}}function oo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return ao(e,n)}function so(e){let t=new Map;for(let n of e){if(!P(n)||typeof n.id!=`string`)continue;let e=new Set,r=n.messages;if(Array.isArray(r))for(let t of r)P(t)&&typeof t.id==`string`&&e.add(t.id);t.set(n.id,e)}return t}function co(e,t){let n=so(t);for(let t=0;t<e.length;t++){let r=e[t];if(!P(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 lo(e){let t=new Map;for(let n of e){if(!P(n)||typeof n.id!=`string`)continue;let e=Array.isArray(n.messages)?n.messages:[];t.set(n.id,new Set(eo(e)))}return t}function uo(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!P(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 fo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return uo(e,n,lo(t))}function po(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 mo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);for(let t=0;t<e.length;t++){let r=e[t];if(!P(r))continue;let i=r.target;if(!P(i))continue;let a=po(i,n,`privacy.redactions[${t}].target`);if(!a.ok)return a}return{ok:!0}}function ho(e){let t=e.conversations,n=e.attachments,r=e.delegations,i=e.privacy,a=Array.isArray(i?.redactions)?i.redactions:[],o=Qa(t);if(!o.ok)return o;let s=$a(t);if(!s.ok)return s;let c=ro(t);if(!c.ok)return c;let l=oo(t,n);if(!l.ok)return l;let u=co(n,t);if(!u.ok)return u;let d=fo(r,t);return d.ok?mo(a,n):d}function go(e){let t=Za(e);return t.ok?ho(e):t}function _o(e){if(!P(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=qa(e.export);if(!t.ok)return t;let n=Ya(e.session);if(!n.ok)return n;let r=Xa(e.privacy);return r.ok?go(e):r}async function vo(e,t,n){let r=await n({method:`GET`,path:`/${e}/sites/${t}/config.json`,origin:Be});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:yo(a),sourceUrl:a}}function yo(e){if(!e)return`da`;let t;try{t=new URL(e).host}catch{return`da`}return t===`api.aem.live`?`aem`:`da`}const bo=`slicc-sprinkle-routes`;function xo(){try{let e=localStorage.getItem(bo);return e?JSON.parse(e):{}}catch{return{}}}function So(e){try{localStorage.setItem(bo,JSON.stringify(e))}catch{}}function Co(e){return xo()[e]}function wo(e,t){let n=xo();n[e]=t,So(n)}function To(e){let t=xo();delete t[e],So(t)}function Eo(){return xo()}function Do(e,t,n){return dt(t,n,`${e} adapter does not implement ${t}.${n}`)}function Oo(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(Do(e,t,n))]});return{...Object.fromEntries(a),allowlist:i,supports:e=>i.includes(e)}}function ko(e){let{adapter:t,pageGestures:n}=e,r=n??{};return{adapter:t,browser:Oo(t,`browser`,mt,e.browser),network:Oo(t,`network`,ut,e.network),secrets:Oo(t,`secrets`,ht,e.secrets),devices:Oo(t,`devices`,gt,{usbRequest:r.usbRequest,serialRequest:r.serialRequest,hidRequest:r.hidRequest,...e.devices}),mounts:Oo(t,`mounts`,ft,{pickDirectory:r.pickDirectory,...e.mounts}),approvals:Oo(t,`approvals`,_t,e.approvals)}}function Ao(e={}){return ko({adapter:`connect`,pageGestures:e.pageGestures})}function jo(e){let t=vt(()=>import(`./extension-ops-B2RMipFn.js`).then(t=>t.createExtensionOps(e)));return ko({adapter:e.adapter,pageGestures:e.pageGestures,network:{crossOriginFetch:e=>w(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>w(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>w(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>w(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>w(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>w(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>w(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function Mo(e={}){let t=vt(()=>import(`./rest-ops-aP40ni1y.js`).then(t=>t.createRestOps(e)),e.controlTimeoutMs??1e4);return ko({adapter:`node-rest`,pageGestures:e.pageGestures,network:{localNodeServer:()=>Promise.resolve({ok:!0,value:{available:!0}}),crossOriginFetch:e=>w(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>w(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>w(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>w(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>w(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>w(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>w(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function No(e,t={}){let{pageGestures:n}=t;switch(e){case`node-rest`:return Mo({pageGestures:n});case`extension-direct`:case`extension-delegate`:return jo({adapter:e,pageGestures:n});case`connect`:return Ao({pageGestures:n})}}const Po=e(`quick-llm`);async function Fo(e){let t=ee();if(!t)return Po.debug(`No API key for active provider — skipping`),null;let n=v(),r=_(),i;if(i=e.modelId?zo(n,e.modelId)??zo(n,r):Io(n,r),!i)return Po.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`]=Bo());try{let n=(await ge(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 Po.debug(`Quick label call failed`,{error:e instanceof Error?e.message:String(e)}),null}}function Io(e,t){let n=te(e);if(n.length===0)return;let r=n.find(e=>e.id===t)??n[0],i=Ro(r.id),a=n.filter(e=>Lo(e,r,i));return a.length===0?r:(a.sort((e,t)=>(e.cost?.input??0)-(t.cost?.input??0)),a[0])}function Lo(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 Ro(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 zo(e,t){return te(e).find(e=>e.id===t)}function Bo(){return bt(`ui-quick-llm`)}const Vo=e(`sudo-suggest`),Ho=[`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{a as t,i as n,n as r,r as i,t as a}from"./snapshot-Dxp0PQCX.js";import{n as o,r as s}from"./panel-rpc-BPwAqRch.js";import{t as c}from"./providers-FzN1gZBm.js";import{r as l,t as u}from"./base64-BPBW1Gzr.js";import{n as d}from"./bridge-protocol-31SWTdS5.js";import{a as f,n as p,o as m,s as h,t as g}from"./handoff-link-B3It6xQY.js";import{d as _,f as v,i as ee,u as te}from"./account-store-BxxO__4E.js";import{a as ne,l as re,n as ie,o as ae}from"./proxied-fetch-CPL8wJM2.js";import{t as oe}from"./runtime-env-DadgceZk.js";import{t as se}from"./slugify-BYJ6QVAt.js";import{n as ce,t as le}from"./host-command-XUdketMY.js";import{r as ue}from"./binary-cache-bSOhqXB1.js";import{i as de,n as fe,r as pe}from"./fetch-body-CuwTaJC_.js";import{o as me,t as he}from"./api-endpoint-3qEcn7BY.js";import{t as ge}from"./compat-uEPf6-XW.js";import{a as _e,i as ve}from"./core-w0-0FXns.js";import{n as ye,t as be}from"./mime-types-D7IV6i7k.js";import{t as xe}from"./secrets-bridge-client-CeK7HpDf.js";import{a as Se,i as Ce,n as we,r as Te}from"./tool-ui-DRnUkp2g.js";import{a as Ee,i as De,n as y,t as b}from"./path-utils-DNJG-zQf.js";import{n as Oe,r as ke,t as Ae}from"./merge-file-core-VJlzucJY.js";import{r as je}from"./workspace-mode-D0kUKBVS.js";import{n as Me,t as Ne}from"./thinking-level-5x0UAu9N.js";import{n as Pe,t as Fe}from"./types-D8gIX-W-.js";import{i as Ie}from"./mount-index-CQfmUPuZ.js";import{a as Le,i as Re,n as ze,o as Be,s as Ve,t as He}from"./signed-fetch-CRbjRIz-.js";import{o as Ue}from"./mount-table-store-DrF_Ifaz.js";import{t as We}from"./remote-cache-BE5T1-53.js";import{n as Ge}from"./fs-MRixwWOW.js";import{a as Ke}from"./tray-leader-status-CpkFr6n7.js";import{n as qe,t as Je}from"./slicc-version-D9AJk7K9.js";import{a as Ye,i as Xe,o as Ze,r as x,t as Qe}from"./browser-eoO4vY7w.js";import{t as S}from"./subcommand-flags-BZi7j78Q.js";import{n as $e,r as et,t as C}from"./subcommand-help-CgO7wRS5.js";import{n as tt}from"./cost-command-BSMq-p2s.js";import{d as nt,g as rt,i as it,n as at,o as ot}from"./sudoers-BdBYQPUn.js";import{n as st,r as ct,t as lt}from"./approval-timeout-BQ29Z0gf.js";import{a as ut,c as dt,i as ft,l as pt,n as mt,o as ht,r as gt,t as _t}from"./types-BfwydWt7.js";import{n as w,t as vt}from"./boundary-Cp9c_bPu.js";import"./rest-paths-Dia19u9P.js";import{t as yt}from"./html-B_Hg2WOy.js";import{n as bt}from"./llm-session-id-BZyXP_j2.js";import{t as xt}from"./buffer-polyfill-BccMjOKj.js";import{i as St,o as Ct}from"./browser-DuyhpHbR.js";import{_ as wt,b as Tt,c as Et,d as Dt,f as Ot,g as kt,h as At,l as jt,m as Mt,n as Nt,o as Pt,p as Ft,s as It,t as Lt,u as Rt,v as zt,x as Bt,y as Vt}from"./jsh-executor-Byc_CbYy.js";import{t as Ht}from"./buffer-B5d1xHaH.js";import{A as Ut,B as T,C as Wt,D as E,E as Gt,F as Kt,G as qt,H as D,I as O,J as Jt,K as Yt,L as Xt,M as Zt,N as Qt,O as $t,P as en,R as tn,S as nn,T as rn,U as an,V as on,W as sn,Y as cn,_ as ln,a as un,b as dn,c as fn,d as pn,f as mn,g as hn,h as gn,i as _n,j as vn,k as yn,l as bn,m as xn,n as Sn,o as Cn,p as k,q as wn,r as Tn,s as En,t as Dn,u as On,v as kn,w as An,x as jn,y as Mn,z as Nn}from"./isomorphic-git-r9mnHMnp.js";import"./global-db-DJXlpNui.js";import{S as Pn,_ as Fn,a as In,b as Ln,c as Rn,d as zn,f as Bn,g as Vn,h as Hn,i as Un,l as Wn,n as Gn,o as Kn,p as qn,r as Jn,s as Yn,t as Xn,u as Zn,v as A,x as j,y as Qn}from"./state-DU-PXpfH.js";import{a as $n,i as er,r as tr,t as nr}from"./git-config-Bdgu8kD2.js";import{i as rr,n as ir,r as ar}from"./jsh-discovery-D3Gk1cKA.js";import{A as or,C as sr,a as cr,b as lr,c as ur,d as dr,f as fr,h as pr,i as mr,j as hr,l as gr,m as _r,n as vr,o as yr,p as br,r as xr,s as Sr,t as M,u as Cr,v as wr,y as Tr}from"./shared-C_68vn79.js";import{B as Er,F as Dr,G as Or,H as kr,J as Ar,K as jr,L as Mr,N as Nr,P as Pr,U as Fr,V as Ir,W as Lr,X as Rr,Y as zr,Z as Br,q as Vr,z as Hr}from"./sync-sab-wire-CC30v4TL.js";import{n as Ur,t as Wr}from"./esbuild-wasm-DS_YG2EY.js";import{n as Gr}from"./wasm-compiler-Ct7QZURL.js";import{a as Kr,o as qr,s as Jr,t as Yr}from"./usb-device-registry-DFzxaOky.js";import{a as N,i as Xr,r as Zr,t as Qr}from"./just-bash-compat-B-SPHuh_.js";import{i as $r,r as ei,t as ti}from"./script-catalog-CgT8L-OG.js";import{a as ni,c as ri,o as ii,s as ai,t as oi}from"./types-Dzr0qYl3.js";import{a as si,c as ci,d as li,f as ui,n as di,r as fi,u as pi}from"./github-zip-sJ90ptuX.js";import{i as mi,t as hi}from"./github-auth-CKAjIBeh.js";import{a as gi,i as _i,o as vi,r as yi,t as bi}from"./provenance-DdmsQ3Nr.js";import{a as xi,c as Si,i as Ci,n as wi,o as Ti,r as Ei,s as Di}from"./github-install-TUO-O3z7.js";import{n as Oi,t as ki}from"./magick-wasm-DCNZhAyd.js";import{i as Ai,n as ji,r as Mi,t as Ni}from"./pdf-raster-BWk6ezTX.js";import{n as Pi}from"./lick-target-env-8JxfVcIV.js";import{t as Fi}from"./tmpdir-env-ate4iNcK.js";import{a as Ii,c as Li,d as Ri,f as zi,i as Bi,l as Vi,n as Hi,o as Ui,p as Wi,r as Gi,s as Ki,t as qi,u as Ji}from"./installer-CyGwaVEH.js";import{t as Yi}from"./ffmpeg-wasm-B77gfnB_.js";import{t as Xi}from"./local-llm-0xPR3YSO.js";import{t as Zi}from"./client-_vVqanZy.js";import{t as Qi}from"./redirect-uri-D2aDPCyB.js";import{a as $i,c as ea,i as ta,o as na,r as ra,s as ia}from"./v86-vm-DCm7zA2r.js";import{n as aa,r as oa}from"./lick-urls-CgPiVwD-.js";let sa=null;function ca(e){sa=e!==null&&Number.isFinite(e)&&e>0?e:null}function la(){if(sa!==null)return sa;let e=globalThis.performance?.timeOrigin;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Date.now()}new URL(d).hostname;const ua=/^([0-9a-f]{32})--(?:[0-9a-f]{8}-)?([0-9a-f]+)$/i;function da(e){let t;try{t=new URL(e.includes(`://`)?e:`https://${e}`).hostname}catch{return null}let n=ua.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 fa(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 pa(e,t){return e.some(e=>fa(e,t))}const ma=`slicc-transcript`,ha=[`canonical-agent-history-unavailable`,`tool-data-may-be-truncated`,`model-metadata-unavailable`,`scoop-history-unavailable`,`attachment-file-missing`,`attachment-association-unavailable`,`complete-snapshot-unavailable`],ga=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 _a(e){return ga.has(e.replace(/\/\d+(?=\/|$)/g,`/*`))}var va=class extends Error{code;detail;constructor(e,t){super(t?`${e}: ${t}`:e),this.code=e,this.detail=t,this.name=`TranscriptExportError`}};const ya=new Set(ha),ba=/^[0-9a-fA-F]{64}$/,xa=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Sa(e){return typeof e==`string`&&ba.test(e)}function Ca(e){return xa.test(e)&&Number.isFinite(Date.parse(e))}function wa(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 Ta(e,t,n){return typeof e!=`string`||!t.includes(e)?{ok:!1,error:wa(n,t)}:{ok:!0}}function Ea(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 Da(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 Oa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Ta(e.type,[`text`,`tool-call`,`attachment-ref`],`${t}.type`);return n.ok?Da(e,t):n}function ka(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 Aa(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 ja(e,t){let n=ka(e,t);if(!n.ok)return n;let r=e.cost;return P(r)?Aa(r,`${t}.cost`):{ok:!1,error:`${t}.cost must be a non-null object`}}function Ma(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`?Ca(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 Na(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 Pa(e,t){let n=e.usage;return n===void 0?{ok:!0}:P(n)?ja(n,`${t}.usage`):{ok:!1,error:`${t}.usage must be a non-null object`}}function Fa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Ta(e.role,[`user`,`assistant`,`tool-result`],`${t}.role`);if(!n.ok)return n;if(e.role===`tool-result`){let n=Na(e,t);if(!n.ok)return n}let r=Ma(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=Ea(i,Oa,`${t}.content`);return a.ok?Pa(e,t):a}function Ia(e,t){if(!P(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=Ta(e.kind,[`cone`,`scoop`],`${t}.kind`);if(!n.ok)return n;let r=e.messages;return Array.isArray(r)?Ea(r,Fa,`${t}.messages`):{ok:!1,error:`${t}.messages must be an array`}}function La(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 Ra(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`}:Sa(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 za=[`attachment-file-missing`,`attachment-association-unavailable`];function Ba(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?r===``?i===0?Ta(e.missingReason,za,`${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 Va(e,t){return e.present?Ra(e,t):Ba(e,t)}function Ha(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=La(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=Ta(e.handling,[`text-redacted`,`binary-unchanged`],`${t}.handling`);return r.ok?Va(e,t):r}function Ua(e,t){let n=Ta(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 Wa(e,t){if(!P(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=Ta(e.detector,[`known-secret`,`credential-pattern`,`pre-obfuscated`],`${t}.detector`);if(!n.ok)return n;let r=e.target;return P(r)?Ua(r,`${t}.target`):{ok:!1,error:`${t}.target must be a non-null object`}}function Ga(e,t){return P(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 Ka(e,t){return typeof e!=`string`||!ya.has(e)?{ok:!1,error:`${t} is not a valid completeness reason`}:{ok:!0}}function qa(e){if(!P(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 P(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 Ja(e){if(!P(e))return{ok:!1,error:`session.completeness must be a non-null object`};let t=Ta(e.status,[`complete`,`partial`],`session.completeness.status`);return t.ok?Array.isArray(e.missing)?Ea(e.missing,Ka,`session.completeness.missing`):{ok:!1,error:`session.completeness.missing must be an array`}:t}function Ya(e){if(!P(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=Ta(e.state,[`active`,`frozen`],`session.state`);return t.ok?Ja(e.completeness):t}function Xa(e){if(!P(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(!P(e.redactionCounts))return{ok:!1,error:`privacy.redactionCounts must be a non-null object`};let n=e.redactions;return Array.isArray(n)?Ea(n,Wa,`privacy.redactions`):{ok:!1,error:`privacy.redactions must be an array`}}function Za(e){let t=e.conversations;if(!Array.isArray(t))return{ok:!1,error:`conversations must be an array`};let n=Ea(t,Ia,`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=Ea(r,Ga,`delegations`);if(!i.ok)return i;let a=e.attachments;return Array.isArray(a)?Ea(a,Ha,`attachments`):{ok:!1,error:`attachments must be an array`}}function Qa(e){let t=new Set,n=new Set;for(let r of e){if(!P(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(!(!P(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 $a(e){for(let t of e){if(!P(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(!P(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 eo(e){let t=[];for(let n of e){if(!P(n))continue;let e=n.content;if(Array.isArray(e))for(let n of e)P(n)&&n.type===`tool-call`&&typeof n.id==`string`&&t.push(n.id)}return t}function to(e){let t=new Set;for(let n of e){if(!P(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of eo(e))t.add(n)}return t}function no(e,t){for(let n of e){if(!P(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!P(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 ro(e){return no(e,to(e))}function io(e,t){for(let n of e){if(!P(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 ao(e,t){for(let n of e){if(!P(n))continue;let e=n.messages;if(Array.isArray(e))for(let n of e){if(!P(n))continue;let e=n.content;if(!Array.isArray(e))continue;let r=io(e,t);if(!r.ok)return r}}return{ok:!0}}function oo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return ao(e,n)}function so(e){let t=new Map;for(let n of e){if(!P(n)||typeof n.id!=`string`)continue;let e=new Set,r=n.messages;if(Array.isArray(r))for(let t of r)P(t)&&typeof t.id==`string`&&e.add(t.id);t.set(n.id,e)}return t}function co(e,t){let n=so(t);for(let t=0;t<e.length;t++){let r=e[t];if(!P(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 lo(e){let t=new Map;for(let n of e){if(!P(n)||typeof n.id!=`string`)continue;let e=Array.isArray(n.messages)?n.messages:[];t.set(n.id,new Set(eo(e)))}return t}function uo(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];if(!P(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 fo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return uo(e,n,lo(t))}function po(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 mo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);for(let t=0;t<e.length;t++){let r=e[t];if(!P(r))continue;let i=r.target;if(!P(i))continue;let a=po(i,n,`privacy.redactions[${t}].target`);if(!a.ok)return a}return{ok:!0}}function ho(e){let t=e.conversations,n=e.attachments,r=e.delegations,i=e.privacy,a=Array.isArray(i?.redactions)?i.redactions:[],o=Qa(t);if(!o.ok)return o;let s=$a(t);if(!s.ok)return s;let c=ro(t);if(!c.ok)return c;let l=oo(t,n);if(!l.ok)return l;let u=co(n,t);if(!u.ok)return u;let d=fo(r,t);return d.ok?mo(a,n):d}function go(e){let t=Za(e);return t.ok?ho(e):t}function _o(e){if(!P(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=qa(e.export);if(!t.ok)return t;let n=Ya(e.session);if(!n.ok)return n;let r=Xa(e.privacy);return r.ok?go(e):r}async function vo(e,t,n){let r=await n({method:`GET`,path:`/${e}/sites/${t}/config.json`,origin:Be});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:yo(a),sourceUrl:a}}function yo(e){if(!e)return`da`;let t;try{t=new URL(e).host}catch{return`da`}return t===`api.aem.live`?`aem`:`da`}const bo=`slicc-sprinkle-routes`;function xo(){try{let e=localStorage.getItem(bo);return e?JSON.parse(e):{}}catch{return{}}}function So(e){try{localStorage.setItem(bo,JSON.stringify(e))}catch{}}function Co(e){return xo()[e]}function wo(e,t){let n=xo();n[e]=t,So(n)}function To(e){let t=xo();delete t[e],So(t)}function Eo(){return xo()}function Do(e,t,n){return dt(t,n,`${e} adapter does not implement ${t}.${n}`)}function Oo(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(Do(e,t,n))]});return{...Object.fromEntries(a),allowlist:i,supports:e=>i.includes(e)}}function ko(e){let{adapter:t,pageGestures:n}=e,r=n??{};return{adapter:t,browser:Oo(t,`browser`,mt,e.browser),network:Oo(t,`network`,ut,e.network),secrets:Oo(t,`secrets`,ht,e.secrets),devices:Oo(t,`devices`,gt,{usbRequest:r.usbRequest,serialRequest:r.serialRequest,hidRequest:r.hidRequest,...e.devices}),mounts:Oo(t,`mounts`,ft,{pickDirectory:r.pickDirectory,...e.mounts}),approvals:Oo(t,`approvals`,_t,e.approvals)}}function Ao(e={}){return ko({adapter:`connect`,pageGestures:e.pageGestures})}function jo(e){let t=vt(()=>import(`./extension-ops-B2RMipFn.js`).then(t=>t.createExtensionOps(e)));return ko({adapter:e.adapter,pageGestures:e.pageGestures,network:{crossOriginFetch:e=>w(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>w(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>w(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>w(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>w(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>w(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>w(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function Mo(e={}){let t=vt(()=>import(`./rest-ops-aP40ni1y.js`).then(t=>t.createRestOps(e)),e.controlTimeoutMs??1e4);return ko({adapter:`node-rest`,pageGestures:e.pageGestures,network:{localNodeServer:()=>Promise.resolve({ok:!0,value:{available:!0}}),crossOriginFetch:e=>w(`network`,`crossOriginFetch`,async()=>(await t()).crossOriginFetch(e))},secrets:{listMaskedEnv:()=>w(`secrets`,`listMaskedEnv`,async()=>(await t()).secrets.listMaskedEnv()),getMasked:e=>w(`secrets`,`getMasked`,async()=>(await t()).secrets.getMasked(e)),set:e=>w(`secrets`,`set`,async()=>(await t()).secrets.set(e)),delete:e=>w(`secrets`,`delete`,async()=>(await t()).secrets.delete(e))},mounts:{signRequest:e=>w(`mounts`,`signRequest`,async()=>(await t()).signRequest(e))},approvals:{request:e=>w(`approvals`,`request`,async()=>(await t()).requestApproval(e))}})}function No(e,t={}){let{pageGestures:n}=t;switch(e){case`node-rest`:return Mo({pageGestures:n});case`extension-direct`:case`extension-delegate`:return jo({adapter:e,pageGestures:n});case`connect`:return Ao({pageGestures:n})}}const Po=e(`quick-llm`);async function Fo(e){let t=ee();if(!t)return Po.debug(`No API key for active provider — skipping`),null;let n=v(),r=_(),i;if(i=e.modelId?zo(n,e.modelId)??zo(n,r):Io(n,r),!i)return Po.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`]=Bo());try{let n=(await ge(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 Po.debug(`Quick label call failed`,{error:e instanceof Error?e.message:String(e)}),null}}function Io(e,t){let n=te(e);if(n.length===0)return;let r=n.find(e=>e.id===t)??n[0],i=Ro(r.id),a=n.filter(e=>Lo(e,r,i));return a.length===0?r:(a.sort((e,t)=>(e.cost?.input??0)-(t.cost?.input??0)),a[0])}function Lo(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 Ro(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 zo(e,t){return te(e).find(e=>e.id===t)}function Bo(){return bt(`ui-quick-llm`)}const Vo=e(`sudo-suggest`),Ho=[`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
|
`),Uo=[`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 Wo(e,t){if(e.suggestedPattern&&e.suggestedPattern.trim().length>0)return e.suggestedPattern.trim();let n=e.detail.trim(),r=e.kind===`command`?Ho:Uo,i=null;try{i=await Fo({prompt:n,system:r,maxTokens:40,temperature:0,signal:t})}catch(e){Vo.debug(`suggestPattern: quickLabel threw`,{error:e instanceof Error?e.message:String(e)}),i=null}return Go(i)||n}function Go(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 Ko=e(`sudo:capability-gesture`);function qo(e,t={}){let n=t.suggest??Wo;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 Ko.warn(`sudo approval aborted before prompting — denying`,{detail:t.detail}),{decision:`deny`};if(!e)return Ko.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?pt(o.value,a):(Ko.warn(`capability broker approvals.request failed — denying`,{message:o.message}),{decision:`deny`})}}}const Jo=e(`sudo:tray-first`);function Yo(e,t={}){let n=t.suggest??Wo,r=t.timeoutMs??6e5,i=t.getClient??(async()=>{let{getPanelRpcClient:e}=await import(`./panel-rpc-BPwAqRch.js`).then(e=>e.i);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){Jo.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 Xo(e?.decision,o)}catch(e){Jo.warn(`tray-first sudo probe failed — using native broker`,{error:e instanceof Error?e.message:String(e)})}return e.requestApproval(s,a)}}}function Xo(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 Zo(e,t){return{requestApproval(n){return t.enqueueSudoRequest(e,n)}}}function Qo(){return`lick-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}var $o=class{pending=new Map;timeoutMs;newId;setTimer;clearTimer;onAutoSettle;constructor(e={}){this.timeoutMs=e.timeoutMs??3e5,this.newId=e.newId??Qo,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(st(`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 es(e){return ct(ts(e))}function ts(e){let t=qo(e);return e?.adapter===`extension-direct`||e?.adapter===`extension-delegate`?t:Yo(t)}let ns=null;function rs(e){return ns=e,()=>{ns===e&&(ns=null)}}function is(){if(!ns)throw new va(`session-not-found`);return ns}const as=`focus`,os={type:`leaf`,surfaceId:`chat`};function ss(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 cs={focus:{name:`focus`,tree:ss({left:os},{left:3,middle:1})}};function ls(e){return cs[e]??null}const us=`progress`;function ds(e){return/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}const fs=e(`mount-picker-popup`),ps=6e4;function ms(e){let t=e??`mount-${Date.now().toString(36)}`;return new Promise(e=>{let n=!1,r=t=>{n||(n=!0,clearTimeout(i),e(t))},i=setTimeout(()=>r({cancelled:!0}),ps);Bt(`directory`,[],t,{timeoutMs:ps}).then(e=>{let n=e;if(n.error){fs.error(`picker popup launch failed for directory kind`,{requestId:t,error:n.error}),r({error:`Failed to open directory picker window`});return}r(n)}).catch(e=>{fs.error(`picker popup launch threw for directory kind`,{requestId:t,error:e instanceof Error?e.message:String(e),name:e instanceof Error?e.name:void 0}),r({error:`Failed to open directory picker window`})})})}async function hs(e){let t=await new Promise((e,t)=>{let n=indexedDB.open(`slicc-pending-mount`,1);n.onupgradeneeded=()=>{n.result.objectStoreNames.contains(`handles`)||n.result.createObjectStore(`handles`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}),n=t.transaction(`handles`,`readwrite`),r=n.objectStore(`handles`),i=r.get(e),a=r.delete(e);a.onerror=()=>{fs.warn(`Failed to delete pending handle from IDB`,{idbKey:e,error:a.error})};let o=await new Promise((e,t)=>{n.oncomplete=()=>e(i.result??null),i.onerror=()=>t(i.error??Error(`IDB get failed`)),n.onerror=()=>t(n.error??Error(`IDB transaction failed`)),n.onabort=()=>t(n.error??Error(`IDB transaction aborted`))});return t.close(),o}async function gs(e){let t=e;if(t.requestPermission){let n=await t.requestPermission({mode:`readwrite`});if(n!==`granted`)throw Error(`Permission denied for "${e.name}" (${n})`)}}async function _s(){try{let e=await ms();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 hs(e.idbKey);if(!t)throw Error(`mount: no directory handle found in storage`);return await gs(t),t}throw Error(`mount: unexpected popup result`)}catch(e){throw Error(`mount: ${e instanceof Error?e.message:String(e)}`)}}async function vs(){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 ys(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 bs(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 xs=new Set([`--source`,`--profile`,`--backend`,`--max-body-mb`]);function Ss(e){for(let t=0;t<e.length;t++){let n=e[t];if(n===`--`)return!1;if(n===`--help`||n===`-h`)return!0;xs.has(n)&&t++}return!1}function Cs(e){return`aem://${e.org}/${e.name}${e.path?`/${e.path}`:``}`}var ws=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=ys(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=Se();if(!n){let n=await Ts(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=oe()?await _s():await vs();let i=Ie.fromHandle(r,{mountId:Ue()});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=Ue(),i=new We({mountId:r,ttlMs:3e4}),a=new Re({source:t.source,profile:n,cache:i,maxBodyBytes:t.maxBodyMb?t.maxBodyMb*1024*1024:void 0,mountId:r,signedFetch:this.signedFetchS3??ze(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??He(),i=bs(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 vo(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=Ue(),c=new We({mountId:s,ttlMs:3e4}),l={source:a===`aem`?Cs(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 Ve(l):new Le(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(Ss(e))return n===`umount`?this.umountHelp():this.help();let r=ys(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-BE5T1-53.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
|
|
@@ -116,7 +116,7 @@ error: Please commit or stash them.
|
|
|
116
116
|
or: git symbolic-ref (-d | --delete) <name>`;function rf(e){let t=Array.isArray(e)?e[e.length-1]:e;return typeof t==`boolean`?t:void 0}function af(e){let t={};typeof e.m==`string`&&(t.m=e.m);let n=rf(e.delete);n!==void 0&&(t.delete=n);let r=rf(e.d);r!==void 0&&(t.d=r);let i=rf(e.quiet);i!==void 0&&(t.quiet=i);let a=rf(e.q);a!==void 0&&(t.q=a);let o=rf(e.short);o!==void 0&&(t.short=o);let s=rf(e.recurse);return s!==void 0&&(t.recurse=s),t}function of(){return{stdout:``,stderr:`${nf}\n`,exitCode:129}}function sf(e){return!e.startsWith(`refs/`)||e.length===5||e.includes(`..`)||e.includes(`@{`)||e.split(`/`).some(e=>!e||e.startsWith(`.`)||e.endsWith(`.`)||e.endsWith(`.lock`))?!1:![...e].some(e=>{let t=e.charCodeAt(0);return t<=32||t===127||`~^:?*[\\`.includes(e)})}async function cf(e,t,n){try{let r=await T({fs:e.lfs,dir:t,ref:n,depth:2});return r.startsWith(`refs/`)?{kind:`symbolic`,target:r}:{kind:`direct`}}catch{return{kind:`missing`}}}async function lf(e,t,n,r){let i=await cf(e,t,n);if(i.kind!==`symbolic`)return{stdout:``,stderr:`fatal: ref ${n} is not a symbolic ref\n`,exitCode:i.kind===`direct`?1:128};if(!r)return i.target;let a=new Set([n]),o=i.target;for(;;){if(a.has(o))return{stdout:``,stderr:`fatal: ref ${n} has a circular symbolic target\n`,exitCode:128};a.add(o);let r=await cf(e,t,o);if(r.kind!==`symbolic`)return o;o=r.target}}function uf(e){for(let t of[`refs/heads/`,`refs/tags/`,`refs/remotes/`])if(e.startsWith(t))return e.slice(t.length);return e.startsWith(`refs/`)?e.slice(5):e}function df(e,t){let n=new Set([`m`,`delete`,`d`,`quiet`,`q`,`short`,`recurse`]),r=Object.keys(e).find(e=>!n.has(e));if(r)return{stdout:``,stderr:`error: unknown option '${r}'\n${nf}\n`,exitCode:129};if(e.m!==void 0)return{stdout:``,stderr:`fatal: option '-m' is not supported because reflogs are not persisted
|
|
117
117
|
`,exitCode:128};if(e.delete===!1||t&&(e.short!==void 0||e.recurse!==void 0))return of()}async function ff(e,t,n,r){if(n===`HEAD`)return{stdout:``,stderr:`fatal: deleting 'HEAD' is not allowed
|
|
118
118
|
`,exitCode:128};let i=await cf(e,t,n);return i.kind===`symbolic`?(await gn({fs:e.lfs,dir:t,ref:n}),{stdout:``,stderr:``,exitCode:0}):{stdout:``,stderr:r?``:`fatal: Cannot delete ${n}, not a symbolic ref\n`,exitCode:i.kind===`direct`?1:128}}async function pf(e,t,n,r){return sf(r)?(await Jt({fs:e.lfs,dir:t,ref:n,value:r,force:!0,symbolic:!0}),{stdout:``,stderr:``,exitCode:0}):{stdout:``,stderr:r.startsWith(`refs/`)?`fatal: Refusing to set '${n}' to invalid ref '${r}'\n`:`fatal: Refusing to point ${n} outside of refs/\n`,exitCode:128}}async function mf(e,t,n,r){let i=await lf(e,t,n,r.recurse!==!1);return typeof i==`string`?{stdout:`${r.short?uf(i):i}\n`,stderr:``,exitCode:0}:r.quiet&&i.exitCode===1?{...i,stderr:``}:i}async function hf(e,t,n){let{flags:r,positionals:i}=j(n,F[`symbolic-ref`]),a=r.delete===!0,o=df(r,a);if(o)return o;let s=r.quiet!==void 0||r.short!==void 0||r.recurse!==void 0;return a?i.length===1?ff(e,t,i[0],!!r.quiet):of():i.length===2?s?of():pf(e,t,i[0],i[1]):i.length===1?mf(e,t,i[0],af(r)):of()}async function gf(e,t,n){let{flags:r,positionals:i}=j(n,F.tag),a=r,o=a.delete===!0,s=I(a,`list`),c=a.annotate===!0,l=I(a,`message`),u=a.force===!0;if(o){let n=i[0];return n?(await ln({fs:e.lfs,dir:t,ref:n}),{stdout:`Deleted tag '${n}'\n`,stderr:``,exitCode:0}):{stdout:``,stderr:`fatal: tag name required
|
|
119
|
-
`,exitCode:128}}if(s!==void 0||i.length===0){let n=await Ut({fs:e.lfs,dir:t}),r=n,i=s||void 0;if(i){let e=RegExp(`^`+i.replace(/\*/g,`.*`)+`$`);r=n.filter(t=>e.test(t))}return{stdout:r.map(e=>`${e}\n`).join(``),stderr:``,exitCode:0}}let d=i[0],f=i[1];if(c||l){let n=await e.resolveAuthor(t);await En({fs:e.lfs,cache:e.cache,dir:t,ref:d,message:l??d,object:f,tagger:{...n,timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0},force:u})}else await an({fs:e.lfs,dir:t,ref:d,object:f,force:u});return{stdout:``,stderr:``,exitCode:0}}function _f(e,t){let n=e===`dir`?16877:e===`symlink`?40960:33188;if(t===void 0)return n;let r=t&4095;return n&61440|r}function vf(e,t){let n=t.mtimeMs??0;return{type:e,mode:_f(e,t.mode),size:t.size??0,ino:t.ino??0,mtimeMs:n,ctimeMs:t.ctimeMs??n,uid:t.uid??1,gid:t.gid??1,dev:1,isFile:()=>e===`file`,isDirectory:()=>e===`dir`,isSymbolicLink:()=>e===`symlink`}}function yf(e){return{size:e.size,mtimeMs:e.mtime,ctimeMs:e.ctime,...e.ino===void 0?{}:{ino:e.ino},...e.uid===void 0?{}:{uid:e.uid},...e.gid===void 0?{}:{gid:e.gid},...e.mode===void 0?{}:{mode:e.mode}}}function bf(e){if(typeof e==`string`)return/^utf-?8$/i.test(e);if(e&&typeof e==`object`){let t=e.encoding;if(typeof t==`string`)return/^utf-?8$/i.test(t)}return!1}function xf(e){if(!e||typeof e!=`object`)return null;let{start:t,end:n}=e;return typeof t!=`number`||typeof n!=`number`?null:{start:t,end:n}}const Sf=`/objects/pack`,Cf=/^(.*\/objects)\/([0-9a-f]{2})\/[0-9a-f]{38,}$/,wf=/\/objects\/[0-9a-f]{2}$/;function Tf(e){return e.endsWith(Sf)||wf.test(e)}function Ef(e){let t=Pe(e);return e.type===`directory`?t?{type:`dir`,stats:t}:{type:`dir`}:t?{type:`file`,stats:t}:void 0}function Df(e){let t=new Map;return{prime(n,r){if(r.length>e){t.clear();return}t.size+r.length>e&&t.clear();let i=y(n),a=i===`/`?`/`:`${i}/`;for(let e of r){let n=Ef(e);n?t.set(`${a}${e.name}`,n):t.delete(`${a}${e.name}`)}},get(e){let n=t.get(y(e));if(n)return vf(n.type,n.stats?yf(n.stats):{})},drop(e){t.delete(y(e))},clear(){t.clear()},size(){return t.size}}}function Of(e,t={}){let n=t.objectCache?{packDirs:new Map,fanouts:new Map}:void 0,r=Df(Math.max(0,t.statCacheMax??1e5)),i=async t=>{let n=await e.readDir(t,Tf(t)?void 0:{includeStats:!0});return r.prime(t,n),n.map(e=>e.name)},a=(e,t)=>{let n=e.fanouts.get(t);if(n)return n;let r=i(t).then(e=>new Set(e));return e.fanouts.set(t,r),r},o=async e=>{if(!n)return!1;let t=Cf.exec(e);if(!t)return!1;try{return!(await a(n,t[1])).has(t[2])}catch{return!1}},s=()=>{n?.packDirs.clear(),n?.fanouts.clear()},c=async(e,t)=>(r.drop(e),await l(t)),l=async e=>{s();try{return await e()}finally{s()}};return{promises:{async readFile(t,n){if(await o(t))throw new Fe(`ENOENT`,`no such file or directory`,t);let r=xf(n);return r?await e.readFileRange(t,r.start,r.end):await e.readFile(t,bf(n)?{encoding:`utf-8`}:{encoding:`binary`})},async writeFile(t,n,r){await c(t,()=>e.writeFile(t,n))},async unlink(t){await c(t,()=>e.rm(t))},async readdir(e){if(!n||!e.endsWith(Sf))return await i(e);let t=n.packDirs.get(e);if(t)return[...await t];let r=i(e);return n.packDirs.set(e,r),[...await r]},async mkdir(t,n){let r=n??void 0;await c(t,()=>e.mkdir(t,r?.recursive===void 0?void 0:{recursive:r.recursive}))},async rmdir(t){r.clear(),await l(()=>e.rm(t))},async stat(t){let n=r.get(t);if(n)return n;let i=await e.stat(t);return vf(i.type===`directory`?`dir`:`file`,yf(i))},async lstat(t){let n=r.get(t);if(n)return n;let i=await e.lstat(t);return vf(i.type===`directory`?`dir`:i.type===`symlink`?`symlink`:`file`,yf(i))},async readlink(t){if(e.isPathUnderMount(t))throw new Fe(`EINVAL`,`symlinks not supported on mounted filesystems`,t);return e.readlink(t)},async symlink(t,n){if(e.isPathUnderMount(n))throw new Fe(`EINVAL`,`symlinks not supported on mounted filesystems`,n);await c(n,()=>e.symlink(t,n))}},clearStatCache(){r.clear()},statCacheSize(){return r.size()}}}const kf={maxEntries:5e4,maxFileBytes:1048576,maxTotalBytes:8388608},Af=new Set([`ENOENT`,`ENOTDIR`,`EISDIR`]);function jf(e){return e.endsWith(`.pack`)||e.endsWith(`.idx`)}function Mf(e){let t=e.replace(/\/{2,}/g,`/`);return t.length>1&&t.endsWith(`/`)?t.slice(0,-1):t}function Nf(e){let t=e.lastIndexOf(`/`);return t<0?`.`:t===0?`/`:e.slice(0,t)}function Pf(e){let t=e?.code;return typeof t==`string`?t:void 0}function Ff(e){return typeof e==`string`?e.length*2:e.byteLength}function If(e,t){return`${t?`u`:`b`} ${e}`}var Lf=class{limits;stats=new Map;lstats=new Map;dirs=new Map;files=new Map;fileBytes=new Map;retainedBytes=0;constructor(e){this.limits=e}hasRoom(){return this.stats.size+this.lstats.size+this.dirs.size+this.files.size<this.limits.maxEntries}retainFile(e,t){let n=Ff(t);return n>this.limits.maxFileBytes||this.retainedBytes+n>this.limits.maxTotalBytes?!1:(this.fileBytes.set(e,n),this.retainedBytes+=n,!0)}dropFile(e){let t=this.fileBytes.get(e);t!==void 0&&(this.fileBytes.delete(e),this.retainedBytes-=t)}forgetSelf(e){this.stats.delete(e),this.lstats.delete(e),this.dirs.delete(e);for(let t of[If(e,!0),If(e,!1)])this.files.delete(t),this.dropFile(t)}invalidatePath(e){let t=Mf(e);this.forgetSelf(t);let n=Nf(t);this.dirs.delete(n),this.stats.delete(n),this.lstats.delete(n)}invalidateSubtree(e){let t=Mf(e),n=`${t}/`;for(let e of[this.stats,this.lstats,this.dirs])for(let t of e.keys())t.startsWith(n)&&e.delete(t);for(let e of this.files.keys())e.slice(2).startsWith(n)&&(this.files.delete(e),this.dropFile(e));this.invalidatePath(t)}};function Rf(e,t,n,r){let i=e.get(t);if(i)return i;let a=n();if(!r.admit())return a;e.set(t,a);let o=()=>{e.get(t)===a&&e.delete(t)};return a.then(e=>{r.keep&&!r.keep(e)&&o()},e=>{Af.has(Pf(e)??``)||o()}),a}function zf(e,t={}){let n=new Lf({...kf,...t}),r=()=>n.hasRoom(),i=async t=>(await Rf(n.dirs,Mf(t),()=>e.readdir(t),{admit:r})).slice(),a=async(t,i)=>{if(jf(t))return e.readFile(t,i);let a=If(Mf(t),bf(i)),o=await Rf(n.files,a,()=>e.readFile(t,i),{admit:r,keep:e=>n.retainFile(a,e)});return typeof o==`string`?o:new Uint8Array(o)},o=(e,t)=>n=>Rf(e,Mf(n),()=>t(n),{admit:r}),s=async(e,t,r=!1)=>{try{return await t()}finally{r?n.invalidateSubtree(e):n.invalidatePath(e)}};return{readFile:a,readdir:i,stat:o(n.stats,t=>e.stat(t)),lstat:o(n.lstats,t=>e.lstat(t)),readlink:t=>e.readlink(t),writeFile:(t,n,r)=>s(t,()=>e.writeFile(t,n,r)),unlink:t=>s(t,()=>e.unlink(t),!0),rmdir:t=>s(t,()=>e.rmdir(t),!0),mkdir:(t,n)=>s(t,()=>e.mkdir(t,n)),symlink:(t,n)=>s(n,()=>e.symlink(t,n))}}const Bf=e(`git-cache`);function Vf(e){for(let t of Object.getOwnPropertySymbols(e)){if(t.description!==`PackfileCache`)continue;let n=e[t];if(n instanceof Map)return n}}function Hf(e){return`${e.replace(/\/+$/,``)}/.git`}var Uf=class{fs;cache={};signatures=new Map;inFlight=0;maxResidentPacks;constructor(e,t={}){this.fs=e,this.maxResidentPacks=Math.max(1,t.maxResidentPacks??4)}setDeepVerification(e){this.cache.skipDeepPackVerification=!e}async beforeCommand(e){this.inFlight++;let t=Hf(e),n=this.signatures.get(t);if(n===void 0)return;let r=await this.packSignature(t);n!==r&&this.invalidate(e),this.signatures.set(t,r)}async afterCommand(e,t={}){this.inFlight=Math.max(0,this.inFlight-1);let n=Hf(e);t.wrotePacks&&(this.invalidate(e),this.signatures.delete(n)),this.inFlight===0&&(await this.evictFailedPacks(),await this.trimResidentPacks()),!this.signatures.has(n)&&this.hasCachedPacks(n)&&this.signatures.set(n,await this.packSignature(n))}async evictFailedPacks(){let e=Vf(this.cache);if(e)for(let[t,n]of[...e]){let r;try{r=await n}catch{e.delete(t);continue}if(!r){e.delete(t);continue}if(r.pack)try{await r.pack||(r.pack=null)}catch{r.pack=null}}}hasCachedPacks(e){let t=Vf(this.cache);if(!t)return!1;let n=`${e}/objects/pack/`;for(let e of t.keys())if(e.startsWith(n))return!0;return!1}invalidate(e){let t=`${Hf(e)}/objects/pack/`,n=Vf(this.cache);if(n)for(let e of[...n.keys()])e.startsWith(t)&&n.delete(e)}async residentPackCount(){return(await this.residentPacks()).length}async packSignature(e){let t=[];try{t=(await this.fs.readdir(`${e}/objects/pack`)).filter(e=>e.endsWith(`.idx`)||e.endsWith(`.pack`)).sort()}catch{}let n=`-`;try{n=String((await this.fs.lstat(`${e}/packed-refs`)).mtimeMs)}catch{}return`${t.join(`,`)}|${n}`}async residentPacks(){let e=Vf(this.cache);if(!e)return[];let t=[];for(let[n,r]of e){let e;try{e=await r}catch{continue}e?.pack&&t.push({key:n,index:e,usedAt:e._lastUsedAt??0})}return t.sort((e,t)=>e.usedAt-t.usedAt),t.map(({key:e,index:t})=>({key:e,index:t}))}async trimResidentPacks(){let e=await this.residentPacks();if(e.length<=this.maxResidentPacks)return;let t=e.slice(0,e.length-this.maxResidentPacks);for(let{index:e}of t)e.pack=null;Bf.debug(`unloaded packfile buffers past the resident bound`,{unloaded:t.length,resident:this.maxResidentPacks})}};const Wf=e(`git-commands`),Gf=new Set([`clone`,`fetch`,`pull`,`push`,`ls-remote`]),Kf=new Set([`clone`,`fetch`,`pull`]),qf=new Set([`add`,`branch`,`commit`,`diff`,`init`,`log`,`ls-files`,`ls-tree`,`merge-base`,`rev-parse`,`show`,`show-ref`,`status`,`symbolic-ref`,`tag`]),Jf={string:[`c`,`C`,`git-dir`,`work-tree`],boolean:[`help`,`version`,`no-pager`,`paginate`,`no-replace-objects`,`color`],alias:{h:`help`},stopEarly:!0};function Yf(e){return e===void 0?[]:(Array.isArray(e)?e:[e]).map(e=>String(e))}function Xf(e,t){if(e instanceof Map){let n=e.get(t);return n&&n.length>0?n:void 0}let n=e[t];return n&&n.length>0?n:void 0}var Zf=class e{options;static globalFsByDbName=new Map;lfs;corsProxy;authorName;authorEmail;globalDbName;githubToken;currentEnv;currentConfigOverrides;currentStdin=``;cacheManager;constructor(e){this.options=e,this.lfs=Of(e.fs,{statCacheMax:0}).promises,this.corsProxy=e.corsProxy,this.authorName=e.authorName??`User`,this.authorEmail=e.authorEmail??`user@example.com`,this.globalDbName=e.globalDbName??`slicc-fs-global`,this.cacheManager=new Uf(this.lfs,{...e.maxResidentPacks===void 0?{}:{maxResidentPacks:e.maxResidentPacks}})}contextFor(e,t){let n=Of(this.options.fs,{objectCache:!0}),r=qf.has(e)?zf(n.promises):n.promises,i=this.createOnAuthFailure();return{ctx:{lfs:r,fs:this.options.fs,cache:this.cacheManager.cache,corsProxy:this.corsProxy,getOnAuth:()=>this.getOnAuth(),getOnAuthFailure:()=>i,resolveAuthor:e=>this.resolveAuthor(e,r),getGlobalFs:()=>this.getGlobalFs(),setGithubToken:e=>this.setGithubToken(e),getGithubToken:()=>this.githubToken,setDefaultAuthorName:e=>{this.authorName=e},setDefaultAuthorEmail:e=>{this.authorEmail=e},getConfigOverrides:()=>this.currentConfigOverrides,stdin:this.currentStdin,useColor:t},client:n}}getOnAuth(){let e=this.resolveAuthToken();if(e)return()=>({username:`x-access-token`,password:e})}createOnAuthFailure(){if(!this.options.ensureFreshGithubToken)return;let e=!1;return async()=>{if(e)return;e=!0;try{await this.options.ensureFreshGithubToken?.({force:!0})}catch(e){Wf.warn(`GitHub token force-renew after 401 failed`,{error:e instanceof Error?e.message:String(e)});return}await this.loadGithubToken();let t=this.resolveAuthToken();if(t)return{username:`x-access-token`,password:t}}}resolveAuthToken(){if(this.githubToken)return this.githubToken;let e=this.currentEnv;if(!e)return;let t=Xf(e,`GH_TOKEN`);if(t)return t;let n=Xf(e,`GITHUB_TOKEN`);if(n)return n}getGlobalFs(){let t=e.globalFsByDbName.get(this.globalDbName);if(t)return t;let n=Ge.create({dbName:this.globalDbName});return e.globalFsByDbName.set(this.globalDbName,n),n}async loadGithubToken(){try{let e=(await(await this.getGlobalFs()).readTextFile(`/workspace/.git/github-token`)).trim();this.githubToken=e||void 0}catch{this.githubToken=void 0}}async ensureFreshGithubToken(e){try{await this.options.ensureFreshGithubToken?.(e)}catch(e){Wf.warn(`GitHub token freshness check failed; continuing with existing auth`,{error:e instanceof Error?e.message:String(e)})}}async setGithubToken(e){let t=e.trim(),n=await this.getGlobalFs();if(!t){try{await n.rm(`/workspace/.git/github-token`)}catch{}this.githubToken=void 0;return}await n.writeFile(`/workspace/.git/github-token`,t),this.githubToken=t}async resolveAuthor(e,t){let n=async n=>{try{return await nn({fs:t,dir:e,path:n})}catch{return}},r=this.currentConfigOverrides,i=await this.getGlobalFs();return{name:r?.get(`user.name`)??await n(`user.name`)??await tr(i,`user.name`)??this.authorName,email:r?.get(`user.email`)??await n(`user.email`)??await tr(i,`user.email`)??this.authorEmail}}async execute(e,t,n,r,i){if(e.length===0)return this.help();let a=this.stripGlobalFlags(Xs(e),t);if(a.versionRequested&&a.remainingArgs.length===0)return this.version();if(a.helpRequested||a.remainingArgs.length===0)return this.help();let o=a.effectiveCwd,[s,...c]=a.remainingArgs,l=F[s]??{},u=j(c,l),d=Object.hasOwn(l.alias??{},`h`);if(u.flags.help||u.flags.h&&!d)return this.help();this.currentEnv=n,this.currentConfigOverrides=a.configOverrides,this.currentStdin=r??``;let f=this.invocationColor(e,n,a.configOverrides,i),{ctx:p,client:m}=this.contextFor(s,f);try{return this.cacheManager.setDeepVerification(this.shouldVerifyPackfiles()),await this.cacheManager.beforeCommand(o),Gf.has(s)&&await this.ensureFreshGithubToken(),await this.loadGithubToken(),await this.dispatch(s,p,o,c)}catch(e){return{stdout:``,stderr:`fatal: ${Bs(e)}\n`,exitCode:128}}finally{await this.cacheManager.afterCommand(o,{wrotePacks:Kf.has(s)}),this.currentEnv=void 0,this.currentConfigOverrides=void 0,this.currentStdin=``,m.clearStatCache()}}async dispatch(e,t,n,r){switch(e){case`init`:return await eu(t,n,r);case`clone`:return await Ac(t,n,r);case`add`:return await Es(t,n,r);case`status`:return await Zd(t,n,r);case`commit`:return await qc(t,n,r);case`log`:return await cu(t,n,r);case`ls-remote`:return await ju(t,n,r);case`branch`:return await tc(t,n,r);case`checkout`:return await nc(t,n,r);case`clean`:return await xc(t,n,r);case`diff`:return await Al(t,n,r);case`show`:return await Od(t,n,r);case`remote`:return await md(t,n,r);case`fetch`:return await Ql(t,n,r);case`pull`:return await Ku(t,n,r);case`push`:return await qu(t,n,r);case`merge`:return await Bu(t,n,r);case`merge-base`:return await Uu(t,n,r);case`cherry-pick`:return await yc(t,n,r);case`rebase`:return await Xu(t,n,r);case`revert`:return await Sd(t,n,r);case`merge-file`:return await Gu(t,n,r);case`reset`:return await hd(t,n,r);case`config`:return await ol(t,n,r);case`tag`:return await gf(t,n,r);case`ls-files`:return await Ou(t,n,r);case`ls-tree`:return await Nu(t,n,r);case`show-ref`:return await jd(t,n,r);case`symbolic-ref`:return await hf(t,n,r);case`stash`:return await Id(t,n,r);case`rm`:return await Ed(t,n,r);case`mv`:{let{mv:e}=await import(`./mv-BE_lEtyG.js`);return await e(t,n,r)}case`rev-parse`:return await xd(t,n,r);case`help`:return this.help();case`version`:return this.version();default:return{stdout:``,stderr:`git: '${e}' is not a git command. See 'git help'.\n`,exitCode:127}}}invocationColor(e,t,n,r){return $s({cliWhen:Ys(e),colorUi:n?.get(`color.ui`),noColorEnv:!!(t&&Xf(t,`NO_COLOR`)),stdoutIsTTY:r?.stdoutIsTTY===!0,term:t?Xf(t,`TERM`):void 0})}shouldVerifyPackfiles(){let e=this.currentEnv,t=e?Xf(e,`SLICC_GIT_VERIFY_PACKS`):void 0;return t===void 0?this.options.verifyPackfiles===!0:t!==`0`&&t.toLowerCase()!==`false`}stripGlobalFlags(e,t){let n=j(e,Jf),r=t;for(let e of Yf(n.flags.C))e!==``&&(r=e.startsWith(`/`)?e:`${r}/${e}`);let i=new Map;for(let e of Yf(n.flags.c)){if(e===``)continue;let t=e.indexOf(`=`);if(t<0){i.set(e.toLowerCase(),``);continue}i.set(e.slice(0,t).toLowerCase(),e.slice(t+1))}return{effectiveCwd:r,remainingArgs:n.positionals,helpRequested:!!(n.flags.help||n.flags.h),versionRequested:!!n.flags.version,configOverrides:i}}version(){return{stdout:`git version 2.43.0 (isomorphic-git ${sn()})\n`,stderr:``,exitCode:0}}help(){return{stdout:`usage: git <command> [<args>]
|
|
119
|
+
`,exitCode:128}}if(s!==void 0||i.length===0){let n=await Ut({fs:e.lfs,dir:t}),r=n,i=s||void 0;if(i){let e=RegExp(`^`+i.replace(/\*/g,`.*`)+`$`);r=n.filter(t=>e.test(t))}return{stdout:r.map(e=>`${e}\n`).join(``),stderr:``,exitCode:0}}let d=i[0],f=i[1];if(c||l){let n=await e.resolveAuthor(t);await En({fs:e.lfs,cache:e.cache,dir:t,ref:d,message:l??d,object:f,tagger:{...n,timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0},force:u})}else await an({fs:e.lfs,dir:t,ref:d,object:f,force:u});return{stdout:``,stderr:``,exitCode:0}}function _f(e,t){let n=e===`dir`?16877:e===`symlink`?40960:33188;if(t===void 0)return n;let r=t&4095;return n&61440|r}function vf(e,t){let n=t.mtimeMs??0;return{type:e,mode:_f(e,t.mode),size:t.size??0,ino:t.ino??0,mtimeMs:n,ctimeMs:t.ctimeMs??n,uid:t.uid??1,gid:t.gid??1,dev:1,isFile:()=>e===`file`,isDirectory:()=>e===`dir`,isSymbolicLink:()=>e===`symlink`}}function yf(e){return{size:e.size,mtimeMs:e.mtime,ctimeMs:e.ctime,...e.ino===void 0?{}:{ino:e.ino},...e.uid===void 0?{}:{uid:e.uid},...e.gid===void 0?{}:{gid:e.gid},...e.mode===void 0?{}:{mode:e.mode}}}function bf(e){if(typeof e==`string`)return/^utf-?8$/i.test(e);if(e&&typeof e==`object`){let t=e.encoding;if(typeof t==`string`)return/^utf-?8$/i.test(t)}return!1}function xf(e){if(!e||typeof e!=`object`)return null;let{start:t,end:n}=e;return typeof t!=`number`||typeof n!=`number`?null:{start:t,end:n}}const Sf=`/objects/pack`,Cf=/^(.*\/objects)\/([0-9a-f]{2})\/[0-9a-f]{38,}$/,wf=/\/objects\/[0-9a-f]{2}$/;function Tf(e){return e.endsWith(Sf)||wf.test(e)}function Ef(e){let t=Pe(e);return e.type===`directory`?t?{type:`dir`,stats:t}:{type:`dir`}:t?{type:`file`,stats:t}:void 0}function Df(e){let t=new Map;return{prime(n,r){if(r.length>e){t.clear();return}t.size+r.length>e&&t.clear();let i=y(n),a=i===`/`?`/`:`${i}/`;for(let e of r){let n=Ef(e);n?t.set(`${a}${e.name}`,n):t.delete(`${a}${e.name}`)}},get(e){let n=t.get(y(e));if(n)return vf(n.type,n.stats?yf(n.stats):{})},drop(e){t.delete(y(e))},clear(){t.clear()},size(){return t.size}}}function Of(e,t={}){let n=t.objectCache?{packDirs:new Map,fanouts:new Map}:void 0,r=Df(Math.max(0,t.statCacheMax??1e5)),i=async t=>{let n=await e.readDir(t,Tf(t)?void 0:{includeStats:!0});return r.prime(t,n),n.map(e=>e.name)},a=(e,t)=>{let n=e.fanouts.get(t);if(n)return n;let r=i(t).then(e=>new Set(e));return e.fanouts.set(t,r),r},o=async e=>{if(!n)return!1;let t=Cf.exec(e);if(!t)return!1;try{return!(await a(n,t[1])).has(t[2])}catch{return!1}},s=()=>{n?.packDirs.clear(),n?.fanouts.clear()},c=async(e,t)=>(r.drop(e),await l(t)),l=async e=>{s();try{return await e()}finally{s()}};return{promises:{async readFile(t,n){if(await o(t))throw new Fe(`ENOENT`,`no such file or directory`,t);let r=xf(n);return r?await e.readFileRange(t,r.start,r.end):await e.readFile(t,bf(n)?{encoding:`utf-8`}:{encoding:`binary`})},async writeFile(t,n,r){await c(t,()=>e.writeFile(t,n))},async unlink(t){await c(t,()=>e.rm(t))},async readdir(e){if(!n||!e.endsWith(Sf))return await i(e);let t=n.packDirs.get(e);if(t)return[...await t];let r=i(e);return n.packDirs.set(e,r),[...await r]},async mkdir(t,n){let r=n??void 0;await c(t,()=>e.mkdir(t,r?.recursive===void 0?void 0:{recursive:r.recursive}))},async rmdir(t){r.clear(),await l(()=>e.rm(t))},async stat(t){let n=r.get(t);if(n)return n;let i=await e.stat(t);return vf(i.type===`directory`?`dir`:`file`,yf(i))},async lstat(t){let n=r.get(t);if(n)return n;let i=await e.lstat(t);return vf(i.type===`directory`?`dir`:i.type===`symlink`?`symlink`:`file`,yf(i))},async readlink(t){if(e.isPathUnderMount(t))throw new Fe(`EINVAL`,`symlinks not supported on mounted filesystems`,t);return e.readlink(t)},async symlink(t,n){if(e.isPathUnderMount(n))throw new Fe(`EINVAL`,`symlinks not supported on mounted filesystems`,n);await c(n,()=>e.symlink(t,n))}},clearStatCache(){r.clear()},statCacheSize(){return r.size()}}}const kf={maxEntries:5e4,maxFileBytes:1048576,maxTotalBytes:8388608},Af=new Set([`ENOENT`,`ENOTDIR`,`EISDIR`]);function jf(e){return e.endsWith(`.pack`)||e.endsWith(`.idx`)}function Mf(e){let t=e.replace(/\/{2,}/g,`/`);return t.length>1&&t.endsWith(`/`)?t.slice(0,-1):t}function Nf(e){let t=e.lastIndexOf(`/`);return t<0?`.`:t===0?`/`:e.slice(0,t)}function Pf(e){let t=e?.code;return typeof t==`string`?t:void 0}function Ff(e){return typeof e==`string`?e.length*2:e.byteLength}function If(e,t){return`${t?`u`:`b`} ${e}`}var Lf=class{limits;stats=new Map;lstats=new Map;dirs=new Map;files=new Map;fileBytes=new Map;retainedBytes=0;constructor(e){this.limits=e}hasRoom(){return this.stats.size+this.lstats.size+this.dirs.size+this.files.size<this.limits.maxEntries}retainFile(e,t){let n=Ff(t);return n>this.limits.maxFileBytes||this.retainedBytes+n>this.limits.maxTotalBytes?!1:(this.fileBytes.set(e,n),this.retainedBytes+=n,!0)}dropFile(e){let t=this.fileBytes.get(e);t!==void 0&&(this.fileBytes.delete(e),this.retainedBytes-=t)}forgetSelf(e){this.stats.delete(e),this.lstats.delete(e),this.dirs.delete(e);for(let t of[If(e,!0),If(e,!1)])this.files.delete(t),this.dropFile(t)}invalidatePath(e){let t=Mf(e);this.forgetSelf(t);let n=Nf(t);this.dirs.delete(n),this.stats.delete(n),this.lstats.delete(n)}invalidateSubtree(e){let t=Mf(e),n=`${t}/`;for(let e of[this.stats,this.lstats,this.dirs])for(let t of e.keys())t.startsWith(n)&&e.delete(t);for(let e of this.files.keys())e.slice(2).startsWith(n)&&(this.files.delete(e),this.dropFile(e));this.invalidatePath(t)}};function Rf(e,t,n,r){let i=e.get(t);if(i)return i;let a=n();if(!r.admit())return a;e.set(t,a);let o=()=>{e.get(t)===a&&e.delete(t)};return a.then(e=>{r.keep&&!r.keep(e)&&o()},e=>{Af.has(Pf(e)??``)||o()}),a}function zf(e,t={}){let n=new Lf({...kf,...t}),r=()=>n.hasRoom(),i=async t=>(await Rf(n.dirs,Mf(t),()=>e.readdir(t),{admit:r})).slice(),a=async(t,i)=>{if(jf(t))return e.readFile(t,i);let a=If(Mf(t),bf(i)),o=await Rf(n.files,a,()=>e.readFile(t,i),{admit:r,keep:e=>n.retainFile(a,e)});return typeof o==`string`?o:new Uint8Array(o)},o=(e,t)=>n=>Rf(e,Mf(n),()=>t(n),{admit:r}),s=async(e,t,r=!1)=>{try{return await t()}finally{r?n.invalidateSubtree(e):n.invalidatePath(e)}};return{readFile:a,readdir:i,stat:o(n.stats,t=>e.stat(t)),lstat:o(n.lstats,t=>e.lstat(t)),readlink:t=>e.readlink(t),writeFile:(t,n,r)=>s(t,()=>e.writeFile(t,n,r)),unlink:t=>s(t,()=>e.unlink(t),!0),rmdir:t=>s(t,()=>e.rmdir(t),!0),mkdir:(t,n)=>s(t,()=>e.mkdir(t,n)),symlink:(t,n)=>s(n,()=>e.symlink(t,n))}}const Bf=e(`git-cache`);function Vf(e){for(let t of Object.getOwnPropertySymbols(e)){if(t.description!==`PackfileCache`)continue;let n=e[t];if(n instanceof Map)return n}}function Hf(e){return`${e.replace(/\/+$/,``)}/.git`}var Uf=class{fs;cache={};signatures=new Map;inFlight=0;maxResidentPacks;constructor(e,t={}){this.fs=e,this.maxResidentPacks=Math.max(1,t.maxResidentPacks??4)}setDeepVerification(e){this.cache.skipDeepPackVerification=!e}async beforeCommand(e){this.inFlight++;let t=Hf(e),n=this.signatures.get(t);if(n===void 0)return;let r=await this.packSignature(t);n!==r&&this.invalidate(e),this.signatures.set(t,r)}async afterCommand(e,t={}){this.inFlight=Math.max(0,this.inFlight-1);let n=Hf(e);t.wrotePacks&&(this.invalidate(e),this.signatures.delete(n)),this.inFlight===0&&(await this.evictFailedPacks(),await this.trimResidentPacks()),!this.signatures.has(n)&&this.hasCachedPacks(n)&&this.signatures.set(n,await this.packSignature(n))}async evictFailedPacks(){let e=Vf(this.cache);if(e)for(let[t,n]of[...e]){let r;try{r=await n}catch{e.delete(t);continue}if(!r){e.delete(t);continue}if(r.pack)try{await r.pack||(r.pack=null)}catch{r.pack=null}}}hasCachedPacks(e){let t=Vf(this.cache);if(!t)return!1;let n=`${e}/objects/pack/`;for(let e of t.keys())if(e.startsWith(n))return!0;return!1}invalidate(e){let t=`${Hf(e)}/objects/pack/`,n=Vf(this.cache);if(n)for(let e of[...n.keys()])e.startsWith(t)&&n.delete(e)}async residentPackCount(){return(await this.residentPacks()).length}async packSignature(e){let t=[];try{t=(await this.fs.readdir(`${e}/objects/pack`)).filter(e=>e.endsWith(`.idx`)||e.endsWith(`.pack`)).sort()}catch{}let n=`-`;try{n=String((await this.fs.lstat(`${e}/packed-refs`)).mtimeMs)}catch{}return`${t.join(`,`)}|${n}`}async residentPacks(){let e=Vf(this.cache);if(!e)return[];let t=[];for(let[n,r]of e){let e;try{e=await r}catch{continue}e?.pack&&t.push({key:n,index:e,usedAt:e._lastUsedAt??0})}return t.sort((e,t)=>e.usedAt-t.usedAt),t.map(({key:e,index:t})=>({key:e,index:t}))}async trimResidentPacks(){let e=await this.residentPacks();if(e.length<=this.maxResidentPacks)return;let t=e.slice(0,e.length-this.maxResidentPacks);for(let{index:e}of t)e.pack=null;Bf.debug(`unloaded packfile buffers past the resident bound`,{unloaded:t.length,resident:this.maxResidentPacks})}};const Wf=e(`git-commands`),Gf=new Set([`clone`,`fetch`,`pull`,`push`,`ls-remote`]),Kf=new Set([`clone`,`fetch`,`pull`]),qf=new Set([`add`,`branch`,`commit`,`diff`,`init`,`log`,`ls-files`,`ls-tree`,`merge-base`,`rev-parse`,`show`,`show-ref`,`status`,`symbolic-ref`,`tag`]),Jf={string:[`c`,`C`,`git-dir`,`work-tree`],boolean:[`help`,`version`,`no-pager`,`paginate`,`no-replace-objects`,`color`],alias:{h:`help`},stopEarly:!0};function Yf(e){return e===void 0?[]:(Array.isArray(e)?e:[e]).map(e=>String(e))}function Xf(e,t){if(e instanceof Map){let n=e.get(t);return n&&n.length>0?n:void 0}let n=e[t];return n&&n.length>0?n:void 0}var Zf=class e{options;static globalFsByDbName=new Map;lfs;corsProxy;authorName;authorEmail;globalDbName;githubToken;currentEnv;currentConfigOverrides;currentStdin=``;cacheManager;constructor(e){this.options=e,this.lfs=Of(e.fs,{statCacheMax:0}).promises,this.corsProxy=e.corsProxy,this.authorName=e.authorName??`User`,this.authorEmail=e.authorEmail??`user@example.com`,this.globalDbName=e.globalDbName??`slicc-fs-global`,this.cacheManager=new Uf(this.lfs,{...e.maxResidentPacks===void 0?{}:{maxResidentPacks:e.maxResidentPacks}})}contextFor(e,t){let n=Of(this.options.fs,{objectCache:!0}),r=qf.has(e)?zf(n.promises):n.promises,i=this.createOnAuthFailure();return{ctx:{lfs:r,fs:this.options.fs,cache:this.cacheManager.cache,corsProxy:this.corsProxy,getOnAuth:()=>this.getOnAuth(),getOnAuthFailure:()=>i,resolveAuthor:e=>this.resolveAuthor(e,r),getGlobalFs:()=>this.getGlobalFs(),setGithubToken:e=>this.setGithubToken(e),getGithubToken:()=>this.githubToken,setDefaultAuthorName:e=>{this.authorName=e},setDefaultAuthorEmail:e=>{this.authorEmail=e},getConfigOverrides:()=>this.currentConfigOverrides,stdin:this.currentStdin,useColor:t},client:n}}getOnAuth(){let e=this.resolveAuthToken();if(e)return()=>({username:`x-access-token`,password:e})}createOnAuthFailure(){if(!this.options.ensureFreshGithubToken)return;let e=!1;return async()=>{if(e)return;e=!0;try{await this.options.ensureFreshGithubToken?.({force:!0})}catch(e){Wf.warn(`GitHub token force-renew after 401 failed`,{error:e instanceof Error?e.message:String(e)});return}await this.loadGithubToken();let t=this.resolveAuthToken();if(t)return{username:`x-access-token`,password:t}}}resolveAuthToken(){if(this.githubToken)return this.githubToken;let e=this.currentEnv;if(!e)return;let t=Xf(e,`GH_TOKEN`);if(t)return t;let n=Xf(e,`GITHUB_TOKEN`);if(n)return n}getGlobalFs(){let t=e.globalFsByDbName.get(this.globalDbName);if(t)return t;let n=Ge.create({dbName:this.globalDbName});return e.globalFsByDbName.set(this.globalDbName,n),n}async loadGithubToken(){try{let e=(await(await this.getGlobalFs()).readTextFile(`/workspace/.git/github-token`)).trim();this.githubToken=e||void 0}catch{this.githubToken=void 0}}async ensureFreshGithubToken(e){try{await this.options.ensureFreshGithubToken?.(e)}catch(e){Wf.warn(`GitHub token freshness check failed; continuing with existing auth`,{error:e instanceof Error?e.message:String(e)})}}async setGithubToken(e){let t=e.trim(),n=await this.getGlobalFs();if(!t){try{await n.rm(`/workspace/.git/github-token`)}catch{}this.githubToken=void 0;return}await n.writeFile(`/workspace/.git/github-token`,t),this.githubToken=t}async resolveAuthor(e,t){let n=async n=>{try{return await nn({fs:t,dir:e,path:n})}catch{return}},r=this.currentConfigOverrides,i=await this.getGlobalFs();return{name:r?.get(`user.name`)??await n(`user.name`)??await tr(i,`user.name`)??this.authorName,email:r?.get(`user.email`)??await n(`user.email`)??await tr(i,`user.email`)??this.authorEmail}}async execute(e,t,n,r,i){if(e.length===0)return this.help();let a=this.stripGlobalFlags(Xs(e),t);if(a.versionRequested&&a.remainingArgs.length===0)return this.version();if(a.helpRequested||a.remainingArgs.length===0)return this.help();let o=a.effectiveCwd,[s,...c]=a.remainingArgs,l=F[s]??{},u=j(c,l),d=Object.hasOwn(l.alias??{},`h`);if(u.flags.help||u.flags.h&&!d)return this.help();this.currentEnv=n,this.currentConfigOverrides=a.configOverrides,this.currentStdin=r??``;let f=this.invocationColor(e,n,a.configOverrides,i),{ctx:p,client:m}=this.contextFor(s,f);try{return this.cacheManager.setDeepVerification(this.shouldVerifyPackfiles()),await this.cacheManager.beforeCommand(o),Gf.has(s)&&await this.ensureFreshGithubToken(),await this.loadGithubToken(),await this.dispatch(s,p,o,c)}catch(e){return{stdout:``,stderr:`fatal: ${Bs(e)}\n`,exitCode:128}}finally{await this.cacheManager.afterCommand(o,{wrotePacks:Kf.has(s)}),this.currentEnv=void 0,this.currentConfigOverrides=void 0,this.currentStdin=``,m.clearStatCache()}}async dispatch(e,t,n,r){switch(e){case`init`:return await eu(t,n,r);case`clone`:return await Ac(t,n,r);case`add`:return await Es(t,n,r);case`status`:return await Zd(t,n,r);case`commit`:return await qc(t,n,r);case`log`:return await cu(t,n,r);case`ls-remote`:return await ju(t,n,r);case`branch`:return await tc(t,n,r);case`checkout`:return await nc(t,n,r);case`clean`:return await xc(t,n,r);case`diff`:return await Al(t,n,r);case`show`:return await Od(t,n,r);case`remote`:return await md(t,n,r);case`fetch`:return await Ql(t,n,r);case`pull`:return await Ku(t,n,r);case`push`:return await qu(t,n,r);case`merge`:return await Bu(t,n,r);case`merge-base`:return await Uu(t,n,r);case`cherry-pick`:return await yc(t,n,r);case`rebase`:return await Xu(t,n,r);case`revert`:return await Sd(t,n,r);case`merge-file`:return await Gu(t,n,r);case`reset`:return await hd(t,n,r);case`config`:return await ol(t,n,r);case`tag`:return await gf(t,n,r);case`ls-files`:return await Ou(t,n,r);case`ls-tree`:return await Nu(t,n,r);case`show-ref`:return await jd(t,n,r);case`symbolic-ref`:return await hf(t,n,r);case`stash`:return await Id(t,n,r);case`rm`:return await Ed(t,n,r);case`mv`:{let{mv:e}=await import(`./mv-ohCkaQgo.js`);return await e(t,n,r)}case`rev-parse`:return await xd(t,n,r);case`help`:return this.help();case`version`:return this.version();default:return{stdout:``,stderr:`git: '${e}' is not a git command. See 'git help'.\n`,exitCode:127}}}invocationColor(e,t,n,r){return $s({cliWhen:Ys(e),colorUi:n?.get(`color.ui`),noColorEnv:!!(t&&Xf(t,`NO_COLOR`)),stdoutIsTTY:r?.stdoutIsTTY===!0,term:t?Xf(t,`TERM`):void 0})}shouldVerifyPackfiles(){let e=this.currentEnv,t=e?Xf(e,`SLICC_GIT_VERIFY_PACKS`):void 0;return t===void 0?this.options.verifyPackfiles===!0:t!==`0`&&t.toLowerCase()!==`false`}stripGlobalFlags(e,t){let n=j(e,Jf),r=t;for(let e of Yf(n.flags.C))e!==``&&(r=e.startsWith(`/`)?e:`${r}/${e}`);let i=new Map;for(let e of Yf(n.flags.c)){if(e===``)continue;let t=e.indexOf(`=`);if(t<0){i.set(e.toLowerCase(),``);continue}i.set(e.slice(0,t).toLowerCase(),e.slice(t+1))}return{effectiveCwd:r,remainingArgs:n.positionals,helpRequested:!!(n.flags.help||n.flags.h),versionRequested:!!n.flags.version,configOverrides:i}}version(){return{stdout:`git version 2.43.0 (isomorphic-git ${sn()})\n`,stderr:``,exitCode:0}}help(){return{stdout:`usage: git <command> [<args>]
|
|
120
120
|
|
|
121
121
|
Available commands:
|
|
122
122
|
init Initialize a new repository
|
|
@@ -275,7 +275,7 @@ Examples:
|
|
|
275
275
|
skill list
|
|
276
276
|
skill info bluebubbles
|
|
277
277
|
skill read bluebubbles
|
|
278
|
-
`,stderr:``,exitCode:0};let r=t[0],i=await import(`./kernel-worker-
|
|
278
|
+
`,stderr:``,exitCode:0};let r=t[0],i=await import(`./kernel-worker-CN7hm2Lb.js`).then(e=>e.n);try{switch(r){case`list`:return Hm(t,e,i);case`info`:{let n=t[1];if(!n)return{stdout:``,stderr:`skill: info requires a skill name
|
|
279
279
|
`,exitCode:1};let r=await i.getSkillInfo(e,n);return r?{stdout:Bm(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
|
|
280
280
|
`,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+`
|
|
281
281
|
`,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 Wm=[{names:[`--branch`,`-b`],validate:e=>!e.startsWith(`-`)&&f(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=>Ci(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=>m(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 Gm(e){let t={skills:[],dryRun:!1,json:!1};for(let n=0;n<e.length;n++){let r=e[n],i=Wm.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 Km(e,t){return!e||!t||e.byteLength!==t.byteLength?!1:e.every((e,n)=>e===t[n])}async function qm(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 Jm(e,t,n,r){let i=await qm(e,t);return li(n)?i?{status:`kept-local`,write:!1}:{status:`added`,write:!0}:i?Km(i,r)?{status:`unchanged`,write:!1}:{status:`updated`,write:!0}:{status:`added`,write:!0}}async function Ym(e,t,n,r){let i={changes:[],writes:[],removals:[]};for(let[r,a]of n){let n=`${t}/${r}`,{status:o,write:s}=await Jm(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 ui(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 Xm(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 hi(t),d=await _i(s,c,o.ref,u,!0,l||void 0);if(d&&r.sha===d&&await Zm(e,n,r))return{...o,to:d,outcome:`current`,changes:[]};let f=await Qm(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 Ym(e,`${ni}/${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 rh(e,{changes:h,writes:g,removals:_}),await vi(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 Zm(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 Qm(e,t,n,r,i,a,o){let s=await fi(e,t,a,i??`main`);if(s.status===`ok`){let i=si(s.files),a=n||$m(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:nh(i,a),path:a}}try{return{files:th(eh(await di(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 $m(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 eh(e){return new Map([...e].filter(([e])=>ci(e)))}function th(e){return new Map([...e].sort(([e],[t])=>e.localeCompare(t)))}function nh(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);ci(e)&&r.set(e,i)}return th(r)}async function rh(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 ih(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 Fm(o,s,t);if(!c.ok)return{...a,outcome:`error`,error:c.error};let l=`${ni}/${n}/SKILL.md`,u=await qm(e,l),d=new TextEncoder().encode(c.content),f=u!==void 0&&Nm(new TextDecoder().decode(u))===Nm(c.content);if(Km(u,d)||f)return{...a,changes:[{path:`SKILL.md`,status:`unchanged`}]};let p=u?`updated`:`added`;return i||(await e.mkdir(`${ni}/${n}`,{recursive:!0}),await e.writeFile(l,d),await vi(e,n,{...r,files:[`SKILL.md`]})),{...a,outcome:`updated`,changes:[{path:`SKILL.md`,status:p}]}}function ah(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 oh(e,t,n,r){let i=Ci(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 sh(e,t,n){if(t.length===0){let t=await gi(e);return{targets:t.provenanced,missing:[],skipped:t.unattributed}}let r=[],i=[];for(let a of t){let t=await yi(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?oh(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 ch(e){return e.reason===`not-installed`?`upskill: no skill named "${e.name}" is installed — check \`upskill list\`
|
|
@@ -286,7 +286,7 @@ Examples:
|
|
|
286
286
|
`}function dh(e,t,n,r,i){let a=t?`Skill update (dry run — nothing written):
|
|
287
287
|
`:`Skill update:
|
|
288
288
|
`;for(let n of e)a+=ah(n,t);if(i.length>0&&(a+=uh(i)),!n&&r&&e.length>0){let n=i.length>0?`all ${lh(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 fh(e,t,n){let{targets:r,missing:i,skipped:a}=await sh(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 ih(e,t,i.name,i.provenance,n.dryRun):await Xm(e,t,i.name,i.provenance,n.branch,n.dryRun));return{results:o,skipped:a,missing:i}}async function ph(e,t,n){let r=Gm(e);if(r.error)return{stdout:``,stderr:`${r.error}\n`,exitCode:1};let{results:i,missing:a,skipped:o}=await fh(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`:dh([],r.dryRun,!1,!0,o),stderr:``,exitCode:0}:{stdout:``,stderr:a.length?a.map(ch).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 Si();let l=a.map(ch).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:dh(i,r.dryRun,c,u,o),stderr:l,exitCode:+!u}}function mh(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 hh(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 gh(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}${hh(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(`
|
|
289
|
-
`)}\n`}async function _h(e,t){let n=await(await import(`./kernel-worker-
|
|
289
|
+
`)}\n`}async function _h(e,t){let n=await(await import(`./kernel-worker-CN7hm2Lb.js`).then(e=>e.n)).discoverSkills(e);return t?{stdout:`${JSON.stringify({ok:!0,skills:n})}\n`,stderr:``,exitCode:0}:n.length===0?{stdout:`No discoverable local skills found.\n\n${Lm()}`,stderr:``,exitCode:0}:{stdout:zm(n,`Discoverable local skills`),stderr:``,exitCode:0}}async function vh(e,t,n){let{results:r,skipped:i}=await fh(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:gh(r,i),stderr:c,exitCode:+!s}}async function yh(e,t,n){let r=mh(e);return r.error?{stdout:``,stderr:`${r.error}\n`,exitCode:1}:r.outdated?vh(t,n,r.json):_h(t,r.json)}async function bh(e,t){let n=`${ri}/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(mi(e,n))}if(r.status!==200)throw Error(`Tessl returned HTTP ${r.status}`);let i=de(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=xi(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 xh(e,t){let n=`${ri}/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: ${mi(e,n)}`}}if(r.status!==200)return{error:`Tessl search failed (HTTP ${r.status})`};let i=de(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=xi(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 Sh=[{label:`Tessl`,host:new URL(ri).host,fetch:bh},{label:`browse.sh`,host:new URL(oi).host,fetch:Dm}];function Ch(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 wh(e,t,n=1){let r=await Promise.allSettled(Sh.map(n=>n.fetch(e,t))),i=r.map(e=>e.status===`fulfilled`?e.value:[]),a=r.every(e=>e.status===`rejected`),o=Ch(i),s=``;for(let e=0;e<r.length;e++){let t=r[e];if(t.status===`rejected`){let n=Sh[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+=`
|
|
290
290
|
`}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:
|
|
291
291
|
`,p+=` From Tessl: upskill <owner/repo> --skill <name>
|
|
292
292
|
`,p+=` From browse.sh: upskill browse:<hostname>/<task>
|
|
@@ -309,7 +309,7 @@ Examples:
|
|
|
309
309
|
`,{stdout:s,stderr:``,exitCode:0}}function jh(e){return!e||e.startsWith(`-`)?{stdout:``,stderr:`upskill: --branch requires a value
|
|
310
310
|
`,exitCode:1}:f(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
|
|
311
311
|
`,exitCode:1}}function Mh(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`||!m(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
|
|
312
|
-
`,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 Nh(e,t,n){if(!t)return{stdout:``,stderr:`upskill: ${e} requires a skill name\n`,exitCode:1};let r=await import(`./kernel-worker-
|
|
312
|
+
`,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 Nh(e,t,n){if(!t)return{stdout:``,stderr:`upskill: ${e} requires a skill name\n`,exitCode:1};let r=await import(`./kernel-worker-CN7hm2Lb.js`).then(e=>e.n);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 yi(n,t),a=i?bi(i):"Installed from: (no provenance recorded — reinstall to enable `upskill update`)\n";return{stdout:Bm(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+`
|
|
313
313
|
`,stderr:``,exitCode:0}}async function Ph(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 Ti(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 Fh(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 wi(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 Ih(e,t,n,r,i,a,o,s){let c=``,l=``,u=0;for(let d of e){let e=await wi(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 Lh(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 Rh(e,t,n,r){let{owner:i,repo:a}=e,o=t.branch??e.branch,s=t.subPath??e.path,c=await hi(r),l=await Ei(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:Lh(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:Lh(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 fi(i,a,r,o);if(e.status===`ok`){let r=await _i(i,a,o,c,!0,s),l=await Ph(u,i,a,si(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 Fh(u,i,a,c,n,t.force,o,f);({output:p,errors:m,successCount:h}=e)}}else({output:p,errors:m,successCount:h}=await Ih(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 Si()),{stdout:p,stderr:m,exitCode:+!!m}}async function zh(e,t,n,r){switch(e[0]){case`tabs`:return kh(t,n,r,e.includes(`--json`));case`recommendations`:return Ah(t,n,e.includes(`--install`));case`update`:case`upgrade`:return ph(e.slice(1),t,n);case`list`:return yh(e.slice(1),t,n);case`info`:case`read`:return Nh(e[0],e[1],t);case`search`:return Vh(e,n);default:return null}}function Bh(e,t,n){return x(`upskill`,async(r,i)=>{if(r.length===0||r.includes(`--help`)||r.includes(`-h`))return Vm();let a=await zh(r,e,t,n);if(a)return a;let o=Mh(r);if(o.earlyReturn)return o.earlyReturn;if(!o.sourceRef)return Vm();if(o.sourceRef.startsWith(`tessl:`))return Hh(o.sourceRef,o.force,e,t);let s=Am(o.sourceRef);if(s)return Im(s.hostname,s.task,e,t,o.force);let c=Ci(o.sourceRef);return c?Rh(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 Vh(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?wh(a,t,i):Vm()}async function Hh(e,t,n,r){let i=e.slice(6);if(!i)return{stdout:``,stderr:`upskill: tessl: requires a skill name
|
|
314
314
|
`,exitCode:1};let a=await xh(i,r);if(`error`in a)return{stdout:``,stderr:`upskill: ${a.error}\n`,exitCode:1};let o=await hi(r);return wi(a.owner,a.repo,a.skillPath,a.skillName,n,o,t,r)}function Uh(){return{stdout:`usage: afplay [-v volume] [-r rate] <file>
|
|
315
315
|
|
|
@@ -703,7 +703,7 @@ Examples:
|
|
|
703
703
|
`;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+=`
|
|
704
704
|
`;return t}async function $v(e,t){let n=S(e.slice(1),{});if(`error`in n)return Xv(n.error);if(!t()){let e=await Uv();if(!e)return Kv(`list`);let t=await e.listCronTasks();return t.length===0?{stdout:`No active cron tasks
|
|
705
705
|
`,stderr:``,exitCode:0}:{stdout:Qv(t),stderr:``,exitCode:0}}let{ok:r,data:i}=await Jv(`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
|
|
706
|
-
`,stderr:``,exitCode:0}:{stdout:Qv(a),stderr:``,exitCode:0}}async function ey(e,t){let n=e[0],r=S(e.slice(1),{});if(`error`in r)return Xv(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 Uv();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}:Kv(`delete`)}let{ok:a,status:o,data:s}=await Jv(`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 ty(e={}){let t=e.hasLocalNodeServer??(()=>!1);return x(`crontask`,async(e,n)=>{let r=e[0];if(!r||C(e,{valueFlags:Yv}))return qv();try{switch(r){case`create`:return await Zv(e,n.env,t);case`list`:return await $v(e,t);case`delete`:case`kill`:return await ey(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 ny(e){return x(`curlwright`,async(t,n)=>{let{runCurlwright:r}=await import(`./run-
|
|
706
|
+
`,stderr:``,exitCode:0}:{stdout:Qv(a),stderr:``,exitCode:0}}async function ey(e,t){let n=e[0],r=S(e.slice(1),{});if(`error`in r)return Xv(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 Uv();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}:Kv(`delete`)}let{ok:a,status:o,data:s}=await Jv(`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 ty(e={}){let t=e.hasLocalNodeServer??(()=>!1);return x(`crontask`,async(e,n)=>{let r=e[0];if(!r||C(e,{valueFlags:Yv}))return qv();try{switch(r){case`create`:return await Zv(e,n.env,t);case`list`:return await $v(e,t);case`delete`:case`kill`:return await ey(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 ny(e){return x(`curlwright`,async(t,n)=>{let{runCurlwright:r}=await import(`./run-CJjv02IN.js`);return r(e,t,n)})}const ry=`slicc-fs`;async function iy(){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===ry)}catch{return!0}}async function ay(){let e=globalThis.indexedDB;return e?new Promise(t=>{let n;try{n=e.deleteDatabase(ry)}catch{t(`error`);return}n.onsuccess=()=>t(`deleted`),n.onerror=()=>t(`error`),n.onblocked=()=>t(`blocked`)}):`error`}async function oy(){if(!await iy())return{kind:`absent`,message:`legacy slicc-fs IDB not present — nothing to clean`};let e=await ay();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 sy(){return`slicc-fs-cleanup — delete the legacy slicc-fs IndexedDB
|
|
707
707
|
|
|
708
708
|
Usage:
|
|
709
709
|
slicc-fs-cleanup Delete the legacy slicc-fs IDB.
|
|
@@ -911,7 +911,7 @@ Options:
|
|
|
911
911
|
--pattern <glob> File pattern to match, e.g. "*.md", "*.bsh" (required)
|
|
912
912
|
--scoop <target> Scoop name, cone name, or folder. Omit for your own cone.
|
|
913
913
|
--name <name> Human-readable name for the watcher
|
|
914
|
-
`);switch(n){case`list`:return nS(e);case`delete`:return rS(e);case`create`:return await oS(e,t.env);default:return eS(`unknown command: ${n}`)}})}function cS(e){return x(`gelatiere`,async(t,n)=>{let{runGelatiere:r}=await import(`./run-
|
|
914
|
+
`);switch(n){case`list`:return nS(e);case`delete`:return rS(e);case`create`:return await oS(e,t.env);default:return eS(`unknown command: ${n}`)}})}function cS(e){return x(`gelatiere`,async(t,n)=>{let{runGelatiere:r}=await import(`./run-BdDImUoG.js`);return r(t,n,e)})}function lS(e){return typeof e.stdoutIsTTY!=`boolean`||e.stdoutIsTTY}function uS(e,t){return typeof e.stdinIsTTY==`boolean`?e.stdinIsTTY:t===void 0?Xr(e.stdin).length===0:t===0}function dS(){return{stdout:`usage: hear [-i file] [-l lang] [-T seconds] [-d deviceId] [--engine name]
|
|
915
915
|
hear --devices | --status | --warmup
|
|
916
916
|
|
|
917
917
|
Speech recognition: listens on the microphone until you pause, then
|
|
@@ -1196,7 +1196,7 @@ Options:
|
|
|
1196
1196
|
`,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}};async function Lw(e,t){if(!t.sessionDirsCreated){for(let t of[`/.playwright`,`/.playwright/snapshots`,`/.playwright/screenshots`])try{await e.mkdir(t,{recursive:!0})}catch(e){if(!Bn(e))throw e}t.sessionDirsCreated=!0}}async function Rw(e,t,n,r){try{return await e.withTab(n,async e=>{let{url:i,title:o,text:s,refToSelector:c,refToBackendNodeId:l,refToFrameId:u}=await a(e),d={url:i,title:o,refToSelector:c,refToBackendNodeId:l,refToFrameId:u,content:s,timestamp:Date.now()};r.snapshots.set(n,d);let f=[`Page URL: ${i}`,`Page Title: ${o}`,``,s].join(`
|
|
1197
1197
|
`),p=`/.playwright/snapshots/page-${Rn(new Date)}.yml`;return await t.writeFile(p,f),p})}catch{return null}}async function zw(e,t,n){await Lw(e,t);let r=new Date().toISOString(),i=`playwright-cli ${n.command}${n.args.length?` `+n.args.join(` `):``}`,a=n.result.exitCode===0?n.result.stdout.trim()||`OK`:`Error: ${n.result.stderr.trim()}`,o=[`### ${i}`,`- **Time**: ${r}`];if(n.tabUrl||n.targetId){let e=n.tabUrl?`${n.tabUrl}${n.targetId?` (targetId: ${n.targetId})`:``}`:`targetId: ${n.targetId}`;o.push(`- **Tab**: ${e}`)}o.push(`- **Result**: ${a}`),n.snapshotPath&&o.push(``,`[Snapshot](${n.snapshotPath})`),o.push(`---`,``);let s=o.join(`
|
|
1198
1198
|
`)+`
|
|
1199
|
-
`,c=`/.playwright/session.md`,l=``;try{let t=await e.readFile(c);l=typeof t==`string`?t:new TextDecoder().decode(t)}catch{}await e.writeFile(c,l+s)}function Bw(){return import(`./snapshot-features-
|
|
1199
|
+
`,c=`/.playwright/session.md`,l=``;try{let t=await e.readFile(c);l=typeof t==`string`?t:new TextDecoder().decode(t)}catch{}await e.writeFile(c,l+s)}function Bw(){return import(`./snapshot-features-YSQlnH7H.js`)}async function Vw(e,t,n,r){let a=await e.getAccessibilityTreeForFrame(r.frameId),o=new Map,s=new Map,c=new Map,l=i(a,o,s,{value:0},``,`f1`);for(let e of o.keys())c.set(e,r.frameId);let u=l.join(`
|
|
1200
1200
|
`);return t.snapshots.set(n,{url:r.url,title:r.name,refToSelector:o,refToBackendNodeId:s,refToFrameId:c,content:u,timestamp:Date.now()}),u}async function Hw(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() {
|
|
1201
1201
|
this.scrollIntoView({ block: 'center' });
|
|
1202
1202
|
const r = this.getBoundingClientRect();
|
|
@@ -1274,7 +1274,7 @@ Options:
|
|
|
1274
1274
|
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
1275
1275
|
return el.files.length;
|
|
1276
1276
|
})()`,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`,$w],[`state-load`,eT],[`console`,NS],[`requests`,xw],[`request`,Sw],[`request-headers`,Cw],[`request-body`,ww],[`response-headers`,Tw],[`response-body`,Ew],[`mousemove`,TC],[`mousedown`,EC],[`mouseup`,DC],[`mousewheel`,OC],[`drop`,kC],[`route`,Pw],[`route-list`,Fw],[`unroute`,Iw],[`generate-locator`,US],[`highlight`,WS]]);function CT(){let e=(Un.string??[]).map(e=>`--${e}`),t=new Set(Un.boolean??[]);for(let[e,n]of Object.entries(Un.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 wT(e){return e.map(e=>e===`--no-iframes`||e.startsWith(`--no-iframes=`)?e.replace(`--no-iframes`,`--_noiframes`):e)}function TT(e){return{...e,bool:[...e.bool??[],`--_noiframes`],value:[...e.value??[],`--_noiframes`]}}const ET=2e3;function DT(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 OT(e,t,n,r){if(!t||typeof e.getTabLockStats!=`function`)return r;let i=e.getTabLockStats(),a=i.totalWaitMs-t.totalWaitMs;if(a<ET)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>=ET?`${(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.
|
|
1277
|
-
`;return{...r,stderr:r.stderr+c}}async function kT(e,t,n){let r=n instanceof Error?n.message:String(n);return{stdout:``,stderr:`Error: ${(t.tab?await Wn(e,t.tab,n):null)??r}\n`,exitCode:1}}function AT(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 jT(e,t,n){let r=ST.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?AT(e,t,void 0):a}catch(r){return i?.aborted?AT(e,t,r):await kT(n.browser,n.flags,r)}}async function MT(e,t,n,r){let i=S(wT(n),TT(r));if(`error`in i)return{answer:{stdout:``,stderr:`${e} ${t}: ${i.error}\n`,exitCode:1}};let a;try{({flags:a}=Hn(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-
|
|
1277
|
+
`;return{...r,stderr:r.stderr+c}}async function kT(e,t,n){let r=n instanceof Error?n.message:String(n);return{stdout:``,stderr:`Error: ${(t.tab?await Wn(e,t.tab,n):null)??r}\n`,exitCode:1}}function AT(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 jT(e,t,n){let r=ST.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?AT(e,t,void 0):a}catch(r){return i?.aborted?AT(e,t,r):await kT(n.browser,n.flags,r)}}async function MT(e,t,n,r){let i=S(wT(n),TT(r));if(`error`in i)return{answer:{stdout:``,stderr:`${e} ${t}: ${i.error}\n`,exitCode:1}};let a;try{({flags:a}=Hn(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-DGPJ7J8S.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 NT(e,t,n){let r=t?zn(t,n):null,i=CT();return x(e,async(a,o)=>{if(a.length===0||a[0]===`help`||a[0]===`--help`||a[0]===`-h`){let{formatHelp:t}=await import(`./help-DGPJ7J8S.js`);return{stdout:t(e)+`
|
|
1278
1278
|
`,stderr:``,exitCode:0}}let s=a[0],c=a.slice(1),l=await MT(e,s,c,i);if(`answer`in l)return l.answer;let{positional:u,flags:d}=l;if(!t||!r)return{stdout:``,stderr:`${e}: browser APIs are unavailable in this environment\n`,exitCode:1};let f=d.tab??null,p=DT(t,f),m=await jT(e,s,{browser:t,fs:n,state:r,positional:u,flags:d,scratchDir:Fi(o.env),onTab:(e,n)=>t.withTab(e,n,{signal:o.signal}),signal:o.signal}),h=d.tab??null,g=null;Xn.has(s)&&m.exitCode===0&&h&&(g=await Rw(t,n,h,r));try{await zw(n,r,{command:s,args:c,result:m,snapshotPath:g,targetId:h})}catch{}return OT(t,p,f,m)})}const PT=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`,...Jn,`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)`,[...Og]]]);function FT(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:
|
|
1279
1279
|
`);let a=[];for(let[e,t]of PT){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(`
|
|
1280
1280
|
`)+`
|
|
@@ -1459,7 +1459,7 @@ Options:
|
|
|
1459
1459
|
--global Resolve only from the shared global prefix (/shared/lib/node_modules)
|
|
1460
1460
|
-h, --help Show this help message
|
|
1461
1461
|
`}async function eO(e,t){let n=await e.readFile(t);return typeof n==`string`?n:new TextDecoder().decode(n)}async function tO(e,t){try{return(await e.stat(t)).type===`file`}catch{return!1}}async function nO(e,t){try{return(await e.stat(t)).type===`directory`}catch{return!1}}function*rO(e,t=!1){if(t){yield or;return}let n=y(e);for(;yield b(n,`node_modules`),n!==`/`;)n=Ee(n).dir;yield or}async function iO(e,t,n,r=!1){for(let i of rO(t,r)){let t=b(i,`.bin`,n);if(!await tO(e,t))continue;let r=await eO(e,t),a=QD.exec(r),o=Ee(t).dir;return{binFilePath:a?b(o,a[1]):t,argvName:t}}return null}function aO(e){if(e.startsWith(`@`)){let t=e.indexOf(`/`);if(t!==-1)return e.slice(t+1)}return e}function oO(e,t){if(typeof e==`string`)return{binName:aO(t),binPath:e};if(typeof e!=`object`||!e)return null;let n=[t,aO(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 sO(e,t,n,r=!1){for(let i of rO(t,r)){let t=b(i,n),r=b(t,`package.json`);if(!await tO(e,r))continue;let a;try{a=JSON.parse(await eO(e,r))}catch{return null}let o=oO(a.bin,n);if(!o)return null;let s=o.binPath.replace(/^\.\//,``);return{binFilePath:b(t,s),argvName:b(i,`.bin`,o.binName)}}return null}async function cO(e,t,n,r=!1){return await iO(e,t,n,r)??await sO(e,t,n,r)}async function lO(e,t,n){for(let r of rO(t))if(await tO(e,b(r,n,`package.json`)))return!0;return!1}function uO(e){return e instanceof Error?e.message:String(e)}function dO(e,t){return{stdout:``,stderr:`${e}: ${t}\n`,exitCode:1}}async function fO(e,t,n,r){try{let i=await Gi([t],{fs:r.fs,fetch:r.fetch,cwd:n.cwd});if(i.errors.length>0)return{error:dO(e,`failed to install '${t}': ${uO(i.errors[0].error)}`)};let a=i.results.map(t=>`${e}: installed ${t.name}@${t.version}`);return{progress:a.length>0?`${a.join(`
|
|
1462
|
-
`)}\n`:``}}catch(n){return{error:dO(e,`failed to install '${t}': ${uO(n)}`)}}}async function pO(e,t,n,r){return await tO(r,n)?null:await nO(r,n)?dO(e,`bin target '${n}' is a directory, not a file`):dO(e,`bin file '${n}' for '${t}' does not exist`)}async function mO(e,t,n,r,i,a){if(await lO(a.fs,i.cwd,t))return{error:dO(e,`package '${t}' does not expose an executable bin`)};let o=r?void 0:YD(t);if(o)return{error:{stdout:``,stderr:ZD(e,t,n,o),exitCode:1}};let s=await fO(e,t,i,a);if(`error`in s)return s;let c=await cO(a.fs,i.cwd,t);return c?{resolved:c,installProgress:s.progress}:{error:dO(e,`package '${t}' was installed but does not expose an executable bin`)}}function hO(e,t){return{name:e,trusted:!0,async execute(n,r){if(n.length===0||n[0]===`--help`||n[0]===`-h`)return{stdout:$D(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:$D(e),stderr:``,exitCode:1};let c=s[0],l=s.slice(1),u;try{u=await cO(t.fs,r.cwd,c,o)}catch(t){return dO(e,uO(t))}let d=``;if(!u){if(o)return dO(e,`no global bin '${c}' found in ${or}`);let n=await mO(e,c,l,i,r,t);if(`error`in n)return n.error;u=n.resolved,d=n.installProgress}let f=await pO(e,c,u.binFilePath,t.fs);if(f)return f;let p=wt(await eO(t.fs,u.binFilePath)),m=[`node`,u.argvName,...l],h=await Lt(p,m,r,void 0,{filename:u.binFilePath});return{stdout:h.stdout,stderr:d+h.stderr,exitCode:h.exitCode}}}}function gO(e={}){return x(`jshd`,async(t,n)=>{let{runJshd:r}=await import(`./run-
|
|
1462
|
+
`)}\n`:``}}catch(n){return{error:dO(e,`failed to install '${t}': ${uO(n)}`)}}}async function pO(e,t,n,r){return await tO(r,n)?null:await nO(r,n)?dO(e,`bin target '${n}' is a directory, not a file`):dO(e,`bin file '${n}' for '${t}' does not exist`)}async function mO(e,t,n,r,i,a){if(await lO(a.fs,i.cwd,t))return{error:dO(e,`package '${t}' does not expose an executable bin`)};let o=r?void 0:YD(t);if(o)return{error:{stdout:``,stderr:ZD(e,t,n,o),exitCode:1}};let s=await fO(e,t,i,a);if(`error`in s)return s;let c=await cO(a.fs,i.cwd,t);return c?{resolved:c,installProgress:s.progress}:{error:dO(e,`package '${t}' was installed but does not expose an executable bin`)}}function hO(e,t){return{name:e,trusted:!0,async execute(n,r){if(n.length===0||n[0]===`--help`||n[0]===`-h`)return{stdout:$D(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:$D(e),stderr:``,exitCode:1};let c=s[0],l=s.slice(1),u;try{u=await cO(t.fs,r.cwd,c,o)}catch(t){return dO(e,uO(t))}let d=``;if(!u){if(o)return dO(e,`no global bin '${c}' found in ${or}`);let n=await mO(e,c,l,i,r,t);if(`error`in n)return n.error;u=n.resolved,d=n.installProgress}let f=await pO(e,c,u.binFilePath,t.fs);if(f)return f;let p=wt(await eO(t.fs,u.binFilePath)),m=[`node`,u.argvName,...l],h=await Lt(p,m,r,void 0,{filename:u.binFilePath});return{stdout:h.stdout,stderr:d+h.stderr,exitCode:h.exitCode}}}}function gO(e={}){return x(`jshd`,async(t,n)=>{let{runJshd:r}=await import(`./run-DtZxbiwE.js`);return r(t,n,e)})}const _O=new Set([`SIGINT`,`SIGTERM`,`SIGKILL`,`SIGSTOP`,`SIGCONT`]);function vO(e={}){return x(`kill`,async t=>{if(t.length===0||t.includes(`--help`)||t.includes(`-h`))return wO();let n=e.processManager??yO();if(!n)return{stdout:``,stderr:`kill: no process manager available in this runtime
|
|
1463
1463
|
`,exitCode:1};let r=bO(t);if(!r.ok)return{stdout:``,stderr:r.stderr,exitCode:r.exitCode};let{allDelivered:i,errors:a}=xO(n,r.pids,r.signal);return{stdout:``,stderr:a.length?`${a.join(`
|
|
1464
1464
|
`)}\n`:``,exitCode:+!i}})}function yO(){let e=globalThis.__slicc_pm;return e instanceof Object&&typeof e.signal==`function`?e:null}function bO(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
|
|
1465
1465
|
`,exitCode:2};let i=SO(n);if(i instanceof Error)return{ok:!1,stderr:`kill: ${i.message}\n`,exitCode:2};t=i;continue}if(i.startsWith(`-`)){let e=CO(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
|
|
@@ -1532,7 +1532,7 @@ Common base URLs:
|
|
|
1532
1532
|
`)+`
|
|
1533
1533
|
`,stderr:``,exitCode:0}}function ZO(e,t){let n=t.models.length;return{stdout:[`✓ ${e} (${qO(t.runtime,!1)})`,` Saved ${n} model${n===1?``:`s`} to Settings:`,...JO(t.models)].join(`
|
|
1534
1534
|
`)+`
|
|
1535
|
-
`,stderr:``,exitCode:0}}function QO(){return x(GO,async e=>{if(e.includes(`--help`)||e.includes(`-h`))return{stdout:KO(),stderr:``,exitCode:0};let{getApiKeyForProvider:t,getRawApiKeyForProvider:n,getBaseUrlForProvider:r,addAccount:i}=await import(`./account-store-
|
|
1535
|
+
`,stderr:``,exitCode:0}}function QO(){return x(GO,async e=>{if(e.includes(`--help`)||e.includes(`-h`))return{stdout:KO(),stderr:``,exitCode:0};let{getApiKeyForProvider:t,getRawApiKeyForProvider:n,getBaseUrlForProvider:r,addAccount:i}=await import(`./account-store-BxxO__4E.js`).then(e=>e.t),{verifyConnection:a}=await import(`./local-llm-0xPR3YSO.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(GO);if(!s)return{stdout:``,stderr:`Local LLM is not configured. Open Settings → Providers → Local LLM and set a base URL.
|
|
1536
1536
|
`,exitCode:1};let c=await a(s,t(GO)??void 0);if(!c.ok)return YO(s,c);if(o===`discover`){let e=n(GO)??``;return i(GO,e,s,c.models.join(`, `)),ZO(s,c)}return XO(s,c)})}function $O(){return{stdout:`usage: man <topic>
|
|
1537
1537
|
|
|
1538
1538
|
Fetches documentation for a given topic from sliccy.com.
|
|
@@ -1570,20 +1570,20 @@ authorization-code flow, stores the access token, and retries.
|
|
|
1570
1570
|
On success, the server is persisted to /workspace/.mcp/servers.json and
|
|
1571
1571
|
an alias shim is written to /workspace/.mcp/aliases/<name>.jsh so the
|
|
1572
1572
|
short name resolves on the PATH.
|
|
1573
|
-
`);let n=S(e,{});if(`error`in n)return ak(n.error);if(n.positionals.length<2)return W(`mcp add: expected <url> <name>`);let[r,i]=n.positionals;if(!/^https?:\/\//i.test(r))return W(`mcp add: invalid URL "${r}" (must start with http:// or https://)`);if(!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))return W(`mcp add: invalid name "${i}" (letters, digits, _ and - only; must start with a letter)`);let{getServer:a,setServer:o}=await import(`./store-
|
|
1573
|
+
`);let n=S(e,{});if(`error`in n)return ak(n.error);if(n.positionals.length<2)return W(`mcp add: expected <url> <name>`);let[r,i]=n.positionals;if(!/^https?:\/\//i.test(r))return W(`mcp add: invalid URL "${r}" (must start with http:// or https://)`);if(!/^[A-Za-z][A-Za-z0-9_-]*$/.test(i))return W(`mcp add: invalid name "${i}" (letters, digits, _ and - only; must start with a letter)`);let{getServer:a,setServer:o}=await import(`./store-BOb9e9JK.js`).then(e=>e.r);if(await a(i,t.fs))return W(`mcp add: a server named "${i}" already exists`);let{McpClient:s,McpAuthRequiredError:c}=await import(`./client-_vVqanZy.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 lk(r,i,e.resourceMetadataUrl,t),l=new s({url:r,fetchImpl:t.fetchImpl,getAuthHeader:()=>Rk(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 Uk(i,t);let m=await Kk(i,f,t);if(u){let{registerMcpProvider:e}=await import(`./provider-0U_dQCSg.js`);e({name:i,serverUrl:r,auth:u})}return U([`Added MCP server "${i}" → ${r}`,` tools: ${d.length}, apps: ${f.length} (${m} sprinkle${m===1?``:`s`})`,` alias: ${ik}/${i}.jsh`,u?` auth: oauth (provider mcp:${i})`:` auth: none`].join(`
|
|
1574
1574
|
`)+`
|
|
1575
|
-
`)}async function lk(e,t,n,r){let{discoverAuth:i,dynamicRegister:a,runAuthFlow:o}=await import(`./oauth-DR6XMm1M.js`),{saveOAuthAccount:s}=await import(`./account-store-
|
|
1576
|
-
`);let n=S(e,{});if(`error`in n)return ak(n.error);let{ensureAllMcpProvidersRegistered:r}=await import(`./provider-
|
|
1575
|
+
`)}async function lk(e,t,n,r){let{discoverAuth:i,dynamicRegister:a,runAuthFlow:o}=await import(`./oauth-DR6XMm1M.js`),{saveOAuthAccount:s}=await import(`./account-store-BxxO__4E.js`).then(e=>e.t),c=await Bk(r.oauthFetchImpl),l=r.oauthLauncher??await zk(),u=await i(e,n,c);rk.debug(`MCP OAuth discovery succeeded`,{name:t,serverUrl:e,discoveryPath:u.discoveryPath,issuer:u.issuer});let d=await Qi(_e()),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 uk(e,t){if(C(e))return U(`usage: mcp list
|
|
1576
|
+
`);let n=S(e,{});if(`error`in n)return ak(n.error);let{ensureAllMcpProvidersRegistered:r}=await import(`./provider-0U_dQCSg.js`);await r();let{listServers:i}=await import(`./store-BOb9e9JK.js`).then(e=>e.r),a=await i(t.fs),o=Object.keys(a).sort();if(o.length===0)return U("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 U(dk(s))}function dk(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(`
|
|
1577
1577
|
`)+`
|
|
1578
1578
|
`}async function fk(e,t){if(C(e))return U(`usage: mcp search <query>
|
|
1579
1579
|
|
|
1580
1580
|
Case-insensitive substring search across the cached tools of every
|
|
1581
1581
|
registered MCP server. Matches tool name OR description and prints a
|
|
1582
1582
|
table of (server, tool, description, match-field) rows.
|
|
1583
|
-
`);let n=S(e,{});if(`error`in n)return ak(n.error);if(n.positionals.length===0)return W(`mcp search: expected <query>`);let r=n.positionals[0],i=r.toLowerCase(),{ensureAllMcpProvidersRegistered:a}=await import(`./provider-
|
|
1584
|
-
`);let n=S(e,{});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`mcp delete: expected <name>`);let{ensureMcpProviderRegistered:i,removeMcpProvider:a}=await import(`./provider-
|
|
1583
|
+
`);let n=S(e,{});if(`error`in n)return ak(n.error);if(n.positionals.length===0)return W(`mcp search: expected <query>`);let r=n.positionals[0],i=r.toLowerCase(),{ensureAllMcpProvidersRegistered:a}=await import(`./provider-0U_dQCSg.js`);await a();let{listServers:o}=await import(`./store-BOb9e9JK.js`).then(e=>e.r),s=await o(t.fs),c=Object.keys(s).sort();if(c.length===0)return U("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 U(`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,pk(e.description),e.match]);return U(dk(u))}function pk(e){if(!e)return``;let t=e.replace(/\s+/g,` `).trim();return t.length<=60?t:t.slice(0,59)+`…`}async function mk(e,t){if(e.length===0||C(e))return e.length===0?W(`mcp delete: expected <name>`):U(`usage: mcp delete <name>
|
|
1584
|
+
`);let n=S(e,{});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`mcp delete: expected <name>`);let{ensureMcpProviderRegistered:i,removeMcpProvider:a}=await import(`./provider-0U_dQCSg.js`);await i(r);let{deleteServer:o}=await import(`./store-BOb9e9JK.js`).then(e=>e.r),s=await o(r,t.fs);await Wk(r,t),await Gk(r,t);let c=`mcp:${r}`,l=!1;try{let{removeAccount:e,getAccounts:t}=await import(`./account-store-BxxO__4E.js`).then(e=>e.t);t().some(e=>e.providerId===c)&&(await e(c),l=!0)}catch(e){rk.warn(`mcp delete: OAuth removal failed`,{providerId:c,error:e instanceof Error?e.message:String(e)})}let u=a(r);return!s&&!l&&!u?W(`mcp delete: no server, alias, or account found for "${r}"`):U([`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(`
|
|
1585
1585
|
`)+`
|
|
1586
|
-
`)}async function hk(e,t){if(e.length===0)return W(`mcp invoke: expected <name>`);if(C(e.slice(0,1)))return U(vk());let n=S([e[0]],{});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`mcp invoke: expected <name>`);let i=e.slice(1),{ensureMcpProviderRegistered:a}=await import(`./provider-
|
|
1586
|
+
`)}async function hk(e,t){if(e.length===0)return W(`mcp invoke: expected <name>`);if(C(e.slice(0,1)))return U(vk());let n=S([e[0]],{});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`mcp invoke: expected <name>`);let i=e.slice(1),{ensureMcpProviderRegistered:a}=await import(`./provider-0U_dQCSg.js`);await a(r);let{getServer:o}=await import(`./store-BOb9e9JK.js`).then(e=>e.r),s=await o(r,t.fs);if(!s)return W(`mcp invoke: unknown server "${r}" (run \`mcp add <url> ${r}\` first)`);let c=s.tools??[];if(i.length===0||C(i.slice(0,1)))return U(yk(r,s,c));let l=S([i[0]],{});if(`error`in l)return ak(l.error);let u=l.positionals[0];if(!u)return W(`mcp invoke: expected <tool>`);let d=c.find(e=>e.name===u);if(!d)return W(`mcp invoke: unknown tool "${u}" on "${r}" (run \`${r}\` to list tools)`);let{timeoutMs:f,remaining:p,warnings:m}=gk(i.slice(1));if(C(p))return U(xk(r,d));let h=Sk(p,d.inputSchema);if(!h.ok)return W(`mcp invoke: ${h.error}`);let{McpClient:g}=await import(`./client-_vVqanZy.js`).then(e=>e.n),_=new g({url:s.url,fetchImpl:t.fetchImpl,headers:s.headers,getAuthHeader:s.auth?()=>Rk(r):void 0,...f===void 0?{}:{timeoutMs:f}});await _.initialize();let v=Pk(await _.toolsCall(u,h.value));return m.length>0&&(v.stderr=m.map(e=>`${e}\n`).join(``)+v.stderr),v}function gk(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 vk(){return`usage: mcp invoke <name> [tool] [--timeout <seconds>] [--flag value …]
|
|
1587
1587
|
|
|
1588
1588
|
mcp invoke <name> List tools on <name>.
|
|
1589
1589
|
mcp invoke <name> <tool> --help Show flags for <tool>.
|
|
@@ -1616,7 +1616,7 @@ Arguments are coerced according to the tool's JSON Schema:
|
|
|
1616
1616
|
|
|
1617
1617
|
Re-fetches the tool catalog and \`apps/list\` for <name>. Does NOT refresh
|
|
1618
1618
|
OAuth tokens — for OAuth token refresh use \`mcp auth <name>\`.
|
|
1619
|
-
`);let n=S(e,{});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`mcp refresh: expected <name>`);let{ensureMcpProviderRegistered:i}=await import(`./provider-
|
|
1619
|
+
`);let n=S(e,{});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`mcp refresh: expected <name>`);let{ensureMcpProviderRegistered:i}=await import(`./provider-0U_dQCSg.js`);await i(r);let{getServer:a,setServer:o}=await import(`./store-BOb9e9JK.js`).then(e=>e.r),s=await a(r,t.fs);if(!s)return W(`mcp refresh: unknown server "${r}"`);let{McpClient:c,McpAuthRequiredError:l}=await import(`./client-_vVqanZy.js`).then(e=>e.n),u=new c({url:s.url,fetchImpl:t.fetchImpl,headers:s.headers,getAuthHeader:s.auth?()=>Rk(r):void 0});try{await u.initialize()}catch(e){if(e instanceof l)return W(`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 Kk(r,f,t);return U(`Refreshed "${r}" — tools: ${d.length}, apps: ${f.length} (${p} sprinkle${p===1?``:`s`})\n`)}async function Ik(e,t){if(C(e))return U(`usage: mcp auth <name> [--silent | --interactive]
|
|
1620
1620
|
|
|
1621
1621
|
Re-authenticate an existing MCP server. By default, attempts a silent
|
|
1622
1622
|
token renewal using the persisted refresh_token; if that returns no
|
|
@@ -1628,7 +1628,7 @@ Options:
|
|
|
1628
1628
|
-i, --interactive Skip silent renewal and open the OAuth popup
|
|
1629
1629
|
directly. Use after revoking a refresh token or
|
|
1630
1630
|
when the AS no longer accepts the cached one.
|
|
1631
|
-
`);let n=S(e,{bool:nk});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`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 W(`mcp auth: --silent and --interactive are mutually exclusive`);let{ensureMcpProviderRegistered:o}=await import(`./provider-
|
|
1631
|
+
`);let n=S(e,{bool:nk});if(`error`in n)return ak(n.error);let r=n.positionals[0];if(!r)return W(`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 W(`mcp auth: --silent and --interactive are mutually exclusive`);let{ensureMcpProviderRegistered:o}=await import(`./provider-0U_dQCSg.js`),s=await o(r,{fetchImpl:t.oauthFetchImpl,launcher:t.oauthLauncher}),{getServer:c}=await import(`./store-BOb9e9JK.js`).then(e=>e.r),l=await c(r,t.fs);if(!l)return W(`mcp auth: unknown server "${r}" (run \`mcp list\` to see configured servers)`);if(!l.auth)return W(`mcp auth: server "${r}" does not use OAuth`);if(!s)return W(`mcp auth: failed to register provider for "${r}"`);let u=`mcp:${r}`,{getRegisteredProviderConfig:d}=await import(`./providers-FzN1gZBm.js`).then(e=>e.r),f=d(u);if(!f)return W(`mcp auth: provider "${u}" is not registered`);if(a)return await Lk(r,f,t);if(!f.onSilentRenew)return i?W(`mcp auth: provider "${u}" does not support silent renewal; retry without --silent`):await Lk(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 W(`mcp auth: silent renewal for "${r}" failed (${t}); retry without --silent to run the interactive flow`);rk.debug(`mcp auth: silent renewal threw, falling back to interactive`,{name:r,error:t})}return p?U(`Re-authenticated "${r}" via silent renewal (provider ${u})\n`):i?W(`mcp auth: silent renewal for "${r}" returned no token; retry without --silent to run the interactive flow`):await Lk(r,f,t)}async function Lk(e,t,n){if(!t.onOAuthLogin)return W(`mcp auth: provider "${t.id}" does not support interactive OAuth login`);let r=n.oauthLauncher??await zk(),i=!1;return await t.onOAuthLogin(r,()=>{i=!0}),i?U(`Re-authenticated "${e}" via interactive login (provider ${t.id})\n`):W(`mcp auth: interactive login for "${e}" did not complete`)}async function Rk(e){let t=`mcp:${e}`,{getOAuthAccountInfo:n}=await import(`./account-store-BxxO__4E.js`).then(e=>e.t),r=n(t);if(!r)return null;if(r.expired){try{let{getRegisteredProviderConfig:e}=await import(`./providers-FzN1gZBm.js`).then(e=>e.r),n=await e(t)?.onSilentRenew?.();if(n)return`Bearer ${n}`}catch(e){rk.debug(`silent renewal threw`,{providerId:t,error:e instanceof Error?e.message:String(e)})}return null}return`Bearer ${r.token}`}async function zk(){let{createOAuthLauncher:e}=await import(`./oauth-service-CRmx6zI1.js`);return e()}async function Bk(e){if(e)return e;let{createProxiedFetch:t}=await import(`./proxied-fetch-CPL8wJM2.js`).then(e=>e.i),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 Vk(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-MRixwWOW.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 Hk(e){return`// MCP alias for "${e}" — forwards args to \`mcp invoke ${e}\`.
|
|
1632
1632
|
// Auto-generated by \`mcp add ${e}\`; do not edit by hand.
|
|
1633
1633
|
const { promisify } = require('util');
|
|
1634
1634
|
const { exec } = require('child_process');
|
|
@@ -1657,7 +1657,7 @@ try {
|
|
|
1657
1657
|
if (stdout) process.stdout.write(stdout);
|
|
1658
1658
|
if (stderr) process.stderr.write(stderr);
|
|
1659
1659
|
process.exit(exitCode);
|
|
1660
|
-
`}async function Uk(e,t){let n=await Vk(t.fs);await n.mkdir(ik,{recursive:!0}),await n.writeFile(`${ik}/${e}.jsh`,Hk(e)),t.scriptCatalog?.invalidateJsh()}async function Wk(e,t){let n=await Vk(t.fs),r=`${ik}/${e}.jsh`;try{await n.exists(r)&&await n.rm(r)}catch(e){rk.debug(`alias removal failed`,{path:r,error:e instanceof Error?e.message:String(e)})}t.scriptCatalog?.invalidateJsh()}async function Gk(e,t){let{removeAppSprinkles:n}=await import(`./apps-
|
|
1660
|
+
`}async function Uk(e,t){let n=await Vk(t.fs);await n.mkdir(ik,{recursive:!0}),await n.writeFile(`${ik}/${e}.jsh`,Hk(e)),t.scriptCatalog?.invalidateJsh()}async function Wk(e,t){let n=await Vk(t.fs),r=`${ik}/${e}.jsh`;try{await n.exists(r)&&await n.rm(r)}catch(e){rk.debug(`alias removal failed`,{path:r,error:e instanceof Error?e.message:String(e)})}t.scriptCatalog?.invalidateJsh()}async function Gk(e,t){let{removeAppSprinkles:n}=await import(`./apps-BPjJyue-.js`);await n(e,t.fs)}async function Kk(e,t,n){try{let{materializeAppSprinkles:r}=await import(`./apps-BPjJyue-.js`);return(await r(e,t,n.fs)).length}catch(t){return rk.warn(`mcp: failed to materialize app sprinkles`,{name:e,error:t instanceof Error?t.message:String(t)}),0}}function qk(e){return{stdout:``,stderr:`meminfo: ${e}\n`,exitCode:1}}function Jk(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=e,r=`B`;for(let e of t){if(n<1024)break;n/=1024,r=e}return`${n.toFixed(1)} ${r}`}function Yk(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 Xk(){let e=globalThis.performance,t=e?.measureUserAgentSpecificMemory;return t?t.bind(e):null}function Zk(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 Qk(e){let t=[`total: ${Jk(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(`${Jk(e.bytes).padEnd(10)} ${e.types.join(`,`).padEnd(20)} ${Yk(e)}`)}return`${t.join(`
|
|
1661
1661
|
`)}\n`}function $k(e={}){return x(`meminfo`,async t=>{let n=Zk(t);if(`error`in n)return qk(n.error);if(n.help)return{stdout:`meminfo - agent-cluster memory diagnostics
|
|
1662
1662
|
|
|
1663
1663
|
Usage:
|
|
@@ -1669,7 +1669,7 @@ Notes:
|
|
|
1669
1669
|
Document-Isolation-Policy). Embedded floats cannot be isolated and
|
|
1670
1670
|
report why instead.
|
|
1671
1671
|
- The browser randomizes measurement timing — expect a short delay.
|
|
1672
|
-
`,stderr:``,exitCode:0};let r=e.isIsolated?e.isIsolated():globalThis.crossOriginIsolated===!0,i=e.measure??Xk();if(!r&&!e.measure)return qk(`memory measurement requires a cross-origin-isolated runtime (Document-Isolation-Policy) — this runtime is not isolated`);if(!i)return qk(`performance.measureUserAgentSpecificMemory is not available in this browser`);let a;try{a=await i()}catch(e){return qk(e instanceof Error?e.message:String(e))}return n.json?{stdout:`${JSON.stringify(a,null,2)}\n`,stderr:``,exitCode:0}:{stdout:Qk(a),stderr:``,exitCode:0}})}function eA(e){return x(`memory`,async t=>{let{runMemory:n}=await import(`./run-
|
|
1672
|
+
`,stderr:``,exitCode:0};let r=e.isIsolated?e.isIsolated():globalThis.crossOriginIsolated===!0,i=e.measure??Xk();if(!r&&!e.measure)return qk(`memory measurement requires a cross-origin-isolated runtime (Document-Isolation-Policy) — this runtime is not isolated`);if(!i)return qk(`performance.measureUserAgentSpecificMemory is not available in this browser`);let a;try{a=await i()}catch(e){return qk(e instanceof Error?e.message:String(e))}return n.json?{stdout:`${JSON.stringify(a,null,2)}\n`,stderr:``,exitCode:0}:{stdout:Qk(a),stderr:``,exitCode:0}})}function eA(e){return x(`memory`,async t=>{let{runMemory:n}=await import(`./run-DVwTsBN0.js`);return n(t,e)})}function tA(){return x(`mktemp`,async(e,t)=>{let{runMktemp:n}=await import(`./run-dAJe7sKp.js`);return n(e,t)})}const nA=`/.cache/artificial-analysis.json`,rA=[`--all`,`--all-versions`,`--json`,`--refresh`,`--no-benchmarks`,`--help`,`-h`],iA=[`--provider`];function aA(e){return{stdout:``,stderr:e.endsWith(`
|
|
1673
1673
|
`)?e:`${e}\n`,exitCode:1}}async function oA(e){try{let t=await e.readFile(nA),n=JSON.parse(t);if(Date.now()-n.fetchedAt<864e5)return n.models}catch{}return null}function sA(){try{return localStorage.getItem(`aa_api_key`)}catch{return null}}function cA(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 lA(e,t){let n={fetchedAt:Date.now(),models:t};try{await e.mkdir(`/.cache`,{recursive:!0}),await e.writeFile(nA,JSON.stringify(n))}catch{}}async function uA(e,t=!1){if(e&&!t){let t=await oA(e);if(t)return t}let n={Accept:`application/json`},r=sA();r&&(n[`x-api-key`]=r);let i=ie(),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=cA(Array.isArray(s)?s:s.data??s.models??[]);return e&&c.length>0&&await lA(e,c),c}function dA(e){return e.toLowerCase().replace(/\./g,`-`).replace(/-\d{8}$/,``).replace(/-\d{4}$/,``)}function fA(e,t){let n=e.toLowerCase(),r=t.find(e=>e.slug===n);if(r)return r;let i=dA(e),a=t.find(e=>dA(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 pA(){return`models - list available LLM models
|
|
1674
1674
|
|
|
1675
1675
|
Usage: models [options]
|
|
@@ -1684,7 +1684,7 @@ Options:
|
|
|
1684
1684
|
-h, --help Show this help message
|
|
1685
1685
|
`}function mA(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`.replace(`.0M`,`M`):e>=1e3?`${(e/1e3).toFixed(0)}K`:`${e}`}function hA(e){return`$${e.toFixed(2)}`}const gA=/\b(embedding|embed|tts|whisper|dall-e|image-gen|audio|vision-preview)\b/i;function _A(e){let t=`${e.id} ${e.name??``}`;return!gA.test(t)}function vA(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 yA(e){let t=e.toLowerCase();return t=t.replace(/-\d{8}$/,``),t=t.replace(/-\d{4}$/,``),t=t.replace(/-(preview|latest)$/,``),vA(t)??t.replace(/-[\d.]+$/,``)}function bA(e){let t=new Map;for(let n of e){let e=yA(n.id);(!t.has(e)||n.selected)&&t.set(e,n)}return[...t.values()]}function xA(e,t,n,r,i){let a=i?fA(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 SA(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=`${hA(e.cost.input)} / ${hA(e.cost.output)}`,a=`${mA(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(`
|
|
1686
1686
|
`)+`
|
|
1687
|
-
`}function CA(e){let t=S(e,{bool:rA,value:iA});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 wA(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 TA(e,t,n,r,i,a){let o=e.getProviderModels(t).filter(_A);if(o.length===0)return[];let s=o.map(e=>xA(e,t,n,r,i)).sort((e,t)=>t.cost.input-e.cost.input);return a||(s=bA(s)),s}function EA(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 DA(e,t){if(C(e,{valueFlags:iA}))return{stdout:pA(),stderr:``,exitCode:0};let n=CA(e);if(`error`in n)return aA(`models: ${n.error}`);let r=await import(`./account-store-
|
|
1687
|
+
`}function CA(e){let t=S(e,{bool:rA,value:iA});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 wA(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 TA(e,t,n,r,i,a){let o=e.getProviderModels(t).filter(_A);if(o.length===0)return[];let s=o.map(e=>xA(e,t,n,r,i)).sort((e,t)=>t.cost.input-e.cost.input);return a||(s=bA(s)),s}function EA(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 DA(e,t){if(C(e,{valueFlags:iA}))return{stdout:pA(),stderr:``,exitCode:0};let n=CA(e);if(`error`in n)return aA(`models: ${n.error}`);let r=await import(`./account-store-BxxO__4E.js`).then(e=>e.t);if(r.getAccounts().length===0)return aA(`No provider accounts configured. Run the provider settings to add one.
|
|
1688
1688
|
`);let i=r.resolveCurrentModel(),a=i.id,o=i.provider,s=r.getSelectedProvider(),c=r.getSelectedModelId(),l;if(!n.noBenchmarks){let e=await uA(t,n.forceRefresh);e.length>0&&(l=e)}let u=wA(r,n,s);if(`error`in u)return aA(u.error);let d=[],f=[];for(let e of u){let t=TA(r,e,a,o,l,n.allVersions);if(t.length===0){if(!n.allMode)return aA(`No models available for provider ${e}.\n`);continue}if(d.push(...t),!n.jsonMode){let n=r.getProviderConfig(e);f.push(SA(n.name,e,t,!!l))}}return n.jsonMode?{stdout:JSON.stringify(d,null,2)+`
|
|
1689
1689
|
`,stderr:``,exitCode:0}:(n.allVersions||f.push(`Showing latest versions only. Use --all-versions to see all.
|
|
1690
1690
|
`),f.push(EA(o,a,s,c)),{stdout:f.join(`
|
|
@@ -1742,7 +1742,7 @@ Examples:
|
|
|
1742
1742
|
`)}\n`,stderr:``,exitCode:0}}async function QA(e,t,n){if(!t||!n)return{stdout:``,stderr:`oauth-domain add: requires <providerId> and <domain>
|
|
1743
1743
|
`,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 $A(e,t,n){if(!t||!n)return{stdout:``,stderr:`oauth-domain remove: requires <providerId> and <domain>
|
|
1744
1744
|
`,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 ej(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>
|
|
1745
|
-
`,exitCode:1}}async function tj(e,t,n,r){switch(t){case`list`:return ZA(e,n);case`add`:return QA(e,n,r);case`remove`:return $A(e,n,r);case`clear`:return ej(e,n);default:return{stdout:``,stderr:`oauth-domain: unknown subcommand "${t}"\n${YA()}`,exitCode:1}}}function nj(){return x(`oauth-domain`,async e=>{if(e.length===0||C(e))return{stdout:YA(),stderr:``,exitCode:0};let t=S(e);if(`error`in t)return XA(t.error);let[n,r,i]=t.positionals,a=await import(`./account-store-
|
|
1745
|
+
`,exitCode:1}}async function tj(e,t,n,r){switch(t){case`list`:return ZA(e,n);case`add`:return QA(e,n,r);case`remove`:return $A(e,n,r);case`clear`:return ej(e,n);default:return{stdout:``,stderr:`oauth-domain: unknown subcommand "${t}"\n${YA()}`,exitCode:1}}}function nj(){return x(`oauth-domain`,async e=>{if(e.length===0||C(e))return{stdout:YA(),stderr:``,exitCode:0};let t=S(e);if(`error`in t)return XA(t.error);let[n,r,i]=t.positionals,a=await import(`./account-store-BxxO__4E.js`).then(e=>e.t);try{return await tj(a,n,r,i)}catch(e){return XA(e instanceof Error?e.message:String(e))}})}function rj(){return x(`oauth-token`,async(e,t)=>{let{runOAuthToken:n}=await import(`./run-HrV-eacV.js`);return n(e,t)})}const ij=[`--download`,`-d`,`--view`,`-v`],aj=[`--size`],oj={low:256,medium:768,high:1536};function sj(){return{stdout:`usage: open [--download|-d] [--view|-v [--size <spec>]] <url|path> [url|path...]
|
|
1746
1746
|
|
|
1747
1747
|
VFS paths are served in a new browser tab via the preview service worker.
|
|
1748
1748
|
URLs (http/https/etc.) are opened directly in a new tab.
|
|
@@ -1768,7 +1768,7 @@ Examples:
|
|
|
1768
1768
|
`);let i=!1;try{i=(await t.fs.stat(e)).isDirectory}catch{}let a=await ur(t.fs,i?e:yr(e)),o=Br(e,a),s;try{s=await r(o)}catch(e){return G(`${e instanceof Error?e.message:String(e)}\n`)}return gj(`opened ${e} → ${o}${_j(s)}`)}async function wj(e,t,n,r){if(!fr(e)&&e.endsWith(`.shtml`)&&t.fs)return yj(e,t,r.sprinkleManager,r.canOpenWindow,r.openExternal);if(!n.view&&!r.canOpenWindow)return G(`open: browser APIs are unavailable in this environment
|
|
1769
1769
|
`);if(fr(e))return bj(e,r.canOpenWindow,r.openExternal);let i=t.fs.resolvePath(t.cwd,e);return n.view?xj(e,i,t,n.sizeSpec):n.download?Sj(e,i,t,r.hasDom):Cj(i,t,r.canOpenWindow,r.openExternal)}function Tj(e){return x(`open`,async(t,n)=>{if(t.length===0||C(t,{valueFlags:aj}))return sj();let r=hj(t);if(`error`in r)return{stdout:``,stderr:`${r.error}\n`,exitCode:1};let{download:i,view:a,sizeSpec:s,targets:c}=r;if(c.length===0)return sj();let l=globalThis.__slicc_sprinkleManager,u=typeof window<`u`&&typeof document<`u`,d=u?null:o(),f={canOpenWindow:!!e||u||!!d,hasDom:u,sprinkleManager:l,openExternal:vj(e,u,d)},p=[];for(let e of c){let t=await wj(e,n,{view:a,download:i,sizeSpec:s},f);if(!t.ok)return t.result;p.push(t.message)}return{stdout:p.join(`
|
|
1770
1770
|
`)+`
|
|
1771
|
-
`,stderr:``,exitCode:0}})}function Ej(){return x(`patch`,async(e,t)=>{let{runPatch:n}=await import(`./run-
|
|
1771
|
+
`,stderr:``,exitCode:0}})}function Ej(){return x(`patch`,async(e,t)=>{let{runPatch:n}=await import(`./run-DUvX7niM.js`);return n(e,t)})}function Dj(e=`pdftk`){return x(e,async(t,n)=>{let{runPdftk:r}=await import(`./run-BEs473Sp.js`);return r(e,t,n)})}function Oj(){return{stdout:`usage: pdftoppm [options] <input.pdf> [output-prefix]
|
|
1772
1772
|
|
|
1773
1773
|
Rasterize PDF pages to images. Writes <prefix>-<n>.<ext> per page, where <n>
|
|
1774
1774
|
is zero-padded to the digit width of the last page (out-1.png for a 9-page
|
|
@@ -1828,7 +1828,7 @@ Examples:
|
|
|
1828
1828
|
plugin list
|
|
1829
1829
|
plugin info my-plugin
|
|
1830
1830
|
plugin remove my-plugin
|
|
1831
|
-
`}function Gj(e={}){return x(`plugin`,async(t,n)=>{if(t.length===0||t[0]===`--help`||t[0]===`-h`)return Hj(Wj());let r=t[0],i=t.slice(1),a=n?.cwd??`/`;try{switch(r){case`install`:case`add`:return await Qj(i,a,e);case`list`:case`ls`:return await nM(i,e);case`info`:return await rM(i,e);case`validate`:return await iM(i,a,e,Fi(n?.env));case`remove`:case`rm`:case`delete`:return await aM(i,e);default:return K(`plugin: unknown subcommand "${r}" (try \`plugin --help\`)`)}}catch(e){return K(`plugin ${r}: ${e instanceof Error?e.message:String(e)}`)}})}async function Kj(e){if(e.fs)return e.fs;let{VirtualFS:t}=await import(`./fs-
|
|
1831
|
+
`}function Gj(e={}){return x(`plugin`,async(t,n)=>{if(t.length===0||t[0]===`--help`||t[0]===`-h`)return Hj(Wj());let r=t[0],i=t.slice(1),a=n?.cwd??`/`;try{switch(r){case`install`:case`add`:return await Qj(i,a,e);case`list`:case`ls`:return await nM(i,e);case`info`:return await rM(i,e);case`validate`:return await iM(i,a,e,Fi(n?.env));case`remove`:case`rm`:case`delete`:return await aM(i,e);default:return K(`plugin: unknown subcommand "${r}" (try \`plugin --help\`)`)}}catch(e){return K(`plugin ${r}: ${e instanceof Error?e.message:String(e)}`)}})}async function Kj(e){if(e.fs)return e.fs;let{VirtualFS:t}=await import(`./fs-MRixwWOW.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 qj(e,t,n){let r=oM(t,e);if(await n.exists(r))return{kind:`local`,root:r};let{parseGitHubRef:i}=await import(`./github-install-TUO-O3z7.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 Jj(e){let t=e.replace(/[^A-Za-z0-9._-]+/g,`-`);return/^\.+$/.test(t)?t.replace(/\./g,`_`):t}function Yj(e){let t=[e.owner,e.repo,...e.path?[e.path]:[]];return`${Vj}/${t.map(Jj).join(`--`)}`}async function Xj(e,t,n,r){let{fetchRepoZip:i,stripZipPrefix:a,writeZipFilesToDir:o}=await import(`./github-zip-sJ90ptuX.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 Zj(e,t){try{await e.rm(t,{recursive:!0})}catch{}}async function Qj(e,t,n){if(C(e))return Hj(`usage: plugin install <path|repo>
|
|
1832
1832
|
|
|
1833
1833
|
Loads the Agent Plugins package at <path>, or downloads it from a GitHub
|
|
1834
1834
|
reference (owner/repo, owner/repo@branch, or
|
|
@@ -1839,19 +1839,19 @@ mcp.json. On success the plugin is recorded in
|
|
|
1839
1839
|
/workspace/.plugins/plugins.json — its skills then surface through the
|
|
1840
1840
|
standard skills discovery, and each supported streamable-http MCP server
|
|
1841
1841
|
is registered in the MCP store as "<plugin>:<server>".
|
|
1842
|
-
`);let r=Uj(`install`,e);if(!(`ok`in r))return r;if(r.positionals.length<1)return K(`plugin install: expected <path|repo>`);let i=await Kj(n),a=await qj(r.positionals[0],t,i);if(a.kind===`error`)return K(`plugin install: ${a.message}`);let o,s;if(a.kind===`github`){if(!n.fetch)return K(`plugin install: GitHub installs are unavailable (no network fetch configured)`);o=Yj(a.ref),s=a.ref.display;let e=await Xj(a.ref,o,i,n.fetch);if(e)return K(`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 Zj(i,o),K(`plugin install: plugin at ${s??o} was rejected:\n${sM(l.diagnostics)}`);let{plugin:u}=l,d=u.manifest.name,{getInstalledPlugin:f,setInstalledPlugin:p}=await import(`./store-
|
|
1842
|
+
`);let r=Uj(`install`,e);if(!(`ok`in r))return r;if(r.positionals.length<1)return K(`plugin install: expected <path|repo>`);let i=await Kj(n),a=await qj(r.positionals[0],t,i);if(a.kind===`error`)return K(`plugin install: ${a.message}`);let o,s;if(a.kind===`github`){if(!n.fetch)return K(`plugin install: GitHub installs are unavailable (no network fetch configured)`);o=Yj(a.ref),s=a.ref.display;let e=await Xj(a.ref,o,i,n.fetch);if(e)return K(`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 Zj(i,o),K(`plugin install: plugin at ${s??o} was rejected:\n${sM(l.diagnostics)}`);let{plugin:u}=l,d=u.manifest.name,{getInstalledPlugin:f,setInstalledPlugin:p}=await import(`./store-BFiQRp1I.js`),m=await f(d,n.fs);if(m&&m.root!==o)return a.kind===`github`&&await Zj(i,o),K(`plugin install: a plugin named "${d}" is already installed from ${m.root} (remove it first)`);let h=await tM(u,n),g=await eM(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),Hj($j(u,h,g,s??o,l.diagnostics))}function $j(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:`,sM(i)),c.join(`
|
|
1843
1843
|
`)+`
|
|
1844
|
-
`}async function eM(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-
|
|
1845
|
-
`);let n=Uj(`list`,e);if(!(`ok`in n))return n;let{listInstalledPlugins:r}=await import(`./store-
|
|
1844
|
+
`}async function eM(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-BOb9e9JK.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 tM(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-BOb9e9JK.js`).then(e=>e.r),{McpClient:a}=await import(`./client-_vVqanZy.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 nM(e,t){if(C(e))return Hj(`usage: plugin list
|
|
1845
|
+
`);let n=Uj(`list`,e);if(!(`ok`in n))return n;let{listInstalledPlugins:r}=await import(`./store-BFiQRp1I.js`),i=await r(t.fs),a=Object.keys(i).sort();if(a.length===0)return Hj("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 Hj(o.map(e=>e.map((e,t)=>e.padEnd(s[t])).join(` `)).join(`
|
|
1846
1846
|
`)+`
|
|
1847
1847
|
`)}async function rM(e,t){if(C(e))return Hj(`usage: plugin info <name>
|
|
1848
|
-
`);let n=Uj(`info`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return K(`plugin info: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i}=await import(`./store-
|
|
1848
|
+
`);let n=Uj(`info`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return K(`plugin info: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i}=await import(`./store-BFiQRp1I.js`),a=await i(r,t.fs);if(!a)return K(`plugin info: no installed plugin named "${r}"`);let o=await Kj(t),{loadPluginFromDirectory:s}=await import(`./loader-Dw-TPPKt.js`),c=await s(o,a.root);if(!c.ok)return K(`plugin info: plugin at ${a.root} no longer loads:\n${sM(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:`,sM(c.diagnostics)),Hj(d.join(`
|
|
1849
1849
|
`)+`
|
|
1850
1850
|
`)}async function iM(e,t,n,r){if(C(e))return Hj(`usage: plugin validate <path|repo>
|
|
1851
1851
|
`);let i=Uj(`validate`,e);if(!(`ok`in i))return i;if(i.positionals.length<1)return K(`plugin validate: expected <path|repo>`);let a=await Kj(n),o=await qj(i.positionals[0],t,a);if(o.kind===`error`)return K(`plugin validate: ${o.message}`);let s,c=null;if(o.kind===`github`){if(!n.fetch)return K(`plugin validate: GitHub sources are unavailable (no network fetch configured)`);c=`${r}/.plugin-validate/${Yj(o.ref).split(`/`).pop()}`;let e=await Xj(o.ref,c,a,n.fetch);if(e)return K(`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 Zj(a,c)}if(!u.ok)return{stdout:``,stderr:`plugin validate: REJECTED\n${sM(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:`,sM(u.diagnostics)),Hj(p.join(`
|
|
1852
1852
|
`)+`
|
|
1853
1853
|
`)}async function aM(e,t){if(C(e))return Hj(`usage: plugin remove <name>
|
|
1854
|
-
`);let n=Uj(`remove`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return K(`plugin remove: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i,deleteInstalledPlugin:a}=await import(`./store-
|
|
1854
|
+
`);let n=Uj(`remove`,e);if(!(`ok`in n))return n;if(n.positionals.length<1)return K(`plugin remove: expected <name>`);let r=n.positionals[0],{getInstalledPlugin:i,deleteInstalledPlugin:a}=await import(`./store-BFiQRp1I.js`),o=await i(r,t.fs);if(!o)return K(`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-BOb9e9JK.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(`${Vj}/`);return c&&await Zj(await Kj(t),o.root),Hj([`Removed agent plugin "${r}"`,` registry: removed`,` mcp servers: ${s} removed`,c?` files: removed (${o.root})`:` files: left in place (${o.root})`].join(`
|
|
1855
1855
|
`)+`
|
|
1856
1856
|
`)}function oM(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 sM(e){return e.map(e=>` ${e.level===`error`?`error`:`warn `} [${e.component}] ${e.message}`).join(`
|
|
1857
1857
|
`)}const cM=[`pid`,`ppid`,`kind`,`stat`,`start`,`scoop`,`command`],lM=[`pid`,`ppid`,`stat`,`start`,`scoop`,`command`],uM={running:`R`,pending:`S`,exited:`Z`,killed:`K`},dM=[`-a`,`-A`,`-e`,`--all`,`-T`,`--tree`],fM=[`-o`,`--columns`];function pM(e={}){return x(`ps`,async t=>{if(C(t,{valueFlags:fM}))return TM();let n=e.processManager??mM();if(!n)return{stdout:``,stderr:`ps: no process manager available in this runtime
|
|
@@ -2055,7 +2055,7 @@ Limits and lifetime:
|
|
|
2055
2055
|
`,exitCode:1};if(e.ttlMs!==void 0&&e.maxTabs!==void 0)return{stdout:``,stderr:`serve: --ttl cannot be combined with --max-tabs
|
|
2056
2056
|
`,exitCode:1}}async function FP(e,t,n){if(e.ttlMs!==void 0){if(!t)throw Error(`persistent snapshot filesystem unavailable`);return DP(t,n)}}async function IP(e,t,n,r){if(e.length===0||e.includes(`--help`)||e.includes(`-h`))return dP();let i=_P(e);if(i.error)return{stdout:``,stderr:i.error,exitCode:1};let a=await NP(i);if(a)return a;if(!i.directory)return dP();let o=PP(i);if(o)return o;let s=await vP(i.directory,i.entry,t.fs,t.cwd);if(yP(s))return s;let{fullDirectory:c,entryPath:l}=s,u;try{u=await FP(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)
|
|
2057
2057
|
`:``,f=await jP(!i.noBridge&&i.bridge,d);return f.ok?MP(i,c,l,f.webhookId,d,u,n):f.result}function LP(e,t){return x(`serve`,(n,r)=>IP(n,r,e,t))}const RP=`usage: session export [--id <id>] [--output <path>]
|
|
2058
|
-
`;function zP(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 BP(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${RP}`};let n=r[e+1];if(!n||n.startsWith(`-`))return{ok:!1,stderr:`session export: --id requires a value\n${RP}`};t=n,e++}else if(i===`--output`){if(n!==null)return{ok:!1,stderr:`session export: duplicate flag --output\n${RP}`};let t=r[e+1];if(!t||t.startsWith(`-`))return{ok:!1,stderr:`session export: --output requires a path\n${RP}`};n=t,e++}else if(i.startsWith(`-`))return{ok:!1,stderr:`session export: unknown flag ${i}\n${RP}`};else return{ok:!1,stderr:`session export: unexpected argument ${JSON.stringify(i)}\n${RP}`}}return{ok:!0,args:{sessionId:t,outputPath:n}}}async function VP(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||xt(r)!==a.sha256)throw new va(`transfer-corrupt`);return r}async function HP(e,t){let n=BP(e);if(!n.ok)return{stdout:``,stderr:n.stderr,exitCode:1};let{sessionId:r,outputPath:i}=n.args;if(i!==null){let e=zP(i);if(!e.ok)return{stdout:``,stderr:`session export: --output ${e.reason}\n${RP}`,exitCode:1}}let a=r==null?{kind:`active`}:{kind:`frozen`,sessionId:r};try{let e=await is().export(a,{}),n=await VP(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 va?e.code:e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function UP(){return x(`session`,async(e,t)=>{if(e[0]===`export`&&!C(e))return HP(e,t);let{dispatchSessionMemoryAware:n}=await import(`./session-command-memory-
|
|
2058
|
+
`;function zP(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 BP(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${RP}`};let n=r[e+1];if(!n||n.startsWith(`-`))return{ok:!1,stderr:`session export: --id requires a value\n${RP}`};t=n,e++}else if(i===`--output`){if(n!==null)return{ok:!1,stderr:`session export: duplicate flag --output\n${RP}`};let t=r[e+1];if(!t||t.startsWith(`-`))return{ok:!1,stderr:`session export: --output requires a path\n${RP}`};n=t,e++}else if(i.startsWith(`-`))return{ok:!1,stderr:`session export: unknown flag ${i}\n${RP}`};else return{ok:!1,stderr:`session export: unexpected argument ${JSON.stringify(i)}\n${RP}`}}return{ok:!0,args:{sessionId:t,outputPath:n}}}async function VP(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||xt(r)!==a.sha256)throw new va(`transfer-corrupt`);return r}async function HP(e,t){let n=BP(e);if(!n.ok)return{stdout:``,stderr:n.stderr,exitCode:1};let{sessionId:r,outputPath:i}=n.args;if(i!==null){let e=zP(i);if(!e.ok)return{stdout:``,stderr:`session export: --output ${e.reason}\n${RP}`,exitCode:1}}let a=r==null?{kind:`active`}:{kind:`frozen`,sessionId:r};try{let e=await is().export(a,{}),n=await VP(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 va?e.code:e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function UP(){return x(`session`,async(e,t)=>{if(e[0]===`export`&&!C(e))return HP(e,t);let{dispatchSessionMemoryAware:n}=await import(`./session-command-memory-CUv5Wqna.js`);return n(e,t,RP)})}function WP(){return x(`slicc`,async(e,t)=>{let{runSlicc:n}=await import(`./run-CreCrLyX.js`);return await n(e,t)})}const GP=`leader`;function KP(){try{let e=globalThis.localStorage?.getItem(`slicc.leaderSprinkleInstances`);if(e)return JSON.parse(e)}catch{}return[]}function qP(e){return+!!e.leader+e.followers.length}function JP(){return{stdout:`usage: sprinkle <subcommand> [args]
|
|
2059
2059
|
|
|
2060
2060
|
list [--runtime <id>] List sprinkles + an instance line per runtime
|
|
2061
2061
|
open <name> Open a sprinkle by name
|