sliccy 6.171.0 → 6.173.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node-server/_shared/tray-sync-protocol.d.ts +14 -1
- package/dist/node-server/_shared/tray-sync-protocol.d.ts.map +1 -1
- package/dist/node-server/_shared/tray-sync-protocol.js +7 -1
- package/dist/node-server/_shared/tray-sync-protocol.js.map +1 -1
- package/dist/ui/.vite/manifest.json +177 -177
- package/dist/ui/assets/{account-store-CNggMenL.js → account-store-C6L1dPkt.js} +1 -1
- package/dist/ui/assets/{account-store-D6AllWeO.js → account-store-D3tjNT4P.js} +1 -1
- package/dist/ui/assets/{adobe-sAiIGVm_.js → adobe-BsJVFEOb.js} +1 -1
- package/dist/ui/assets/{adobe-CodQnDmm.js → adobe-Cb7lJobO.js} +1 -1
- package/dist/ui/assets/{agent-panels-DOp52Z_M.js → agent-panels-CyCp6NIr.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-CjflttZ7.js → almost-bash-shell-headless-Dafw5-gw.js} +30 -30
- package/dist/ui/assets/{apply-layout-D37XmPxU.js → apply-layout-CbmHO2xe.js} +1 -1
- package/dist/ui/assets/{apps-Ceu8cYEk.js → apps-DPLWQsL8.js} +1 -1
- package/dist/ui/assets/{azure-openai-W6WU26bi.js → azure-openai-BeHB5Xsv.js} +1 -1
- package/dist/ui/assets/{azure-openai-B36P1s83.js → azure-openai-CITkjeFe.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-I8NahEY9.js → backend-hostfs-T96UZnEZ.js} +1 -1
- package/dist/ui/assets/{cdp-VD1YEKQw.js → cdp-D7y24k10.js} +1 -1
- package/dist/ui/assets/{cerebras-i9GYvewj.js → cerebras-UdoC5wna.js} +1 -1
- package/dist/ui/assets/{cerebras-CKYpdbvj.js → cerebras-YvLIdZBU.js} +1 -1
- package/dist/ui/assets/{composer-speech-DT4NWx8-.js → composer-speech-qXN2iUQ7.js} +1 -1
- package/dist/ui/assets/{connect-surface-91_RIWC0.js → connect-surface-DPYMQaVu.js} +1 -1
- package/dist/ui/assets/{directed-approval-BkOYIa7P.js → directed-approval-CfMjkXUm.js} +1 -1
- package/dist/ui/assets/{ensure-speech-assets-j5oGh41B.js → ensure-speech-assets-BVphCEGS.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-spEIzl0z.js → frozen-archive-writer-BPJGcQtg.js} +1 -1
- package/dist/ui/assets/{fs-DDjR1oFG.js → fs-BRbIAzOE.js} +1 -1
- package/dist/ui/assets/{fs-BPGX0vAL.js → fs-_YaqTR32.js} +2 -2
- package/dist/ui/assets/{gelatiere-store-BEjYGUu_.js → gelatiere-store-Bkr9hlLW.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-D5A_2VNU.js → gelatiere-unit-Dnrp5Ftm.js} +1 -1
- package/dist/ui/assets/{github-iYRkjr1C.js → github-B3PQ1AA1.js} +2 -2
- package/dist/ui/assets/{github-CHq633ze.js → github-BZOw2ztu.js} +1 -1
- package/dist/ui/assets/{github-auth-DgpIq4Vt.js → github-auth-Czxpk-jN.js} +1 -1
- package/dist/ui/assets/{github-copilot-CJMpClO2.js → github-copilot-DiSQJOaw.js} +1 -1
- package/dist/ui/assets/{github-copilot-DXNkhK35.js → github-copilot-J-S_dvR-.js} +1 -1
- package/dist/ui/assets/{github-install-DkISdZFD.js → github-install-pEVrJJeI.js} +1 -1
- package/dist/ui/assets/{github-zip-DxtR21Uq.js → github-zip-BIWI8hcq.js} +1 -1
- package/dist/ui/assets/{hear-BUhv_X4G.js → hear-B2pZ12W6.js} +1 -1
- package/dist/ui/assets/{help-Dj8BgmDh.js → help-CBbczzoA.js} +1 -1
- package/dist/ui/assets/{installer-DdsuEiHZ.js → installer-DyZaJqY0.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-fnU12DrV.js → js-realm-worker-Dfvem1xC.js} +1 -1
- package/dist/ui/assets/{jsh-executor-oVgu4z70.js → jsh-executor-N0yksfmJ.js} +2 -2
- package/dist/ui/assets/{kernel-worker-CFArftC0.js → kernel-worker-xwj5OOqP.js} +9 -9
- package/dist/ui/assets/{lick-ws-bridge-Ck30PsgB.js → lick-ws-bridge-DiW8qkFp.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-WmZ-ciRB.js → lick-ws-bridge-KZP5YRxy.js} +1 -1
- package/dist/ui/assets/{live-session-snapshot-DIHZU2wJ.js → live-session-snapshot-D0MfyE4S.js} +1 -1
- package/dist/ui/assets/{local-llm-BP3zyzsz.js → local-llm-BlMy0zGS.js} +1 -1
- package/dist/ui/assets/{local-llm-6HU-uFt3.js → local-llm-Dv_gA3Wl.js} +1 -1
- package/dist/ui/assets/{main-DhZRz895.js → main-DM5_sD1I.js} +3 -3
- package/dist/ui/assets/{main-cherry-CJ6GRga3.js → main-cherry-Cue0Tbcq.js} +1 -1
- package/dist/ui/assets/{memory-curation-seam-B5PiZDsB.js → memory-curation-seam-9wyFEtJO.js} +1 -1
- package/dist/ui/assets/{memory-health-DkUZi8GZ.js → memory-health-Boa-j2cm.js} +1 -1
- package/dist/ui/assets/memory-v2-flag-Buswp5Ao.js +1 -0
- package/dist/ui/assets/{memory-write-execute-Ds-tX_la.js → memory-write-execute-DQ0gwPAM.js} +1 -1
- package/dist/ui/assets/{mount-CJQQgd2k.js → mount-B7WHxASH.js} +3 -3
- package/dist/ui/assets/{mount-CGRT4ThS.js → mount-RA8Tp59q.js} +1 -1
- package/dist/ui/assets/{new-session-Cx6AYP3j.js → new-session-Cme_2VSF.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-BRuhmV28.js → oauth-bootstrap-BPm7EXbR.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-CXy9SXNF.js → onboarding-orchestrator-BrRBkpPX.js} +1 -1
- package/dist/ui/assets/{openai-codex-8iFpp040.js → openai-codex-CswYT7fr.js} +1 -1
- package/dist/ui/assets/{openai-codex-DU43LnYY.js → openai-codex-nho0leBB.js} +1 -1
- package/dist/ui/assets/{openrouter-BJW-Tfmr.js → openrouter-BOj6KoIe.js} +1 -1
- package/dist/ui/assets/{openrouter-DK4aoj7n.js → openrouter-DxJtRw9K.js} +1 -1
- package/dist/ui/assets/{openrouter-free-C2D79frc.js → openrouter-free-CL8ayM9-.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DymYQ6nQ.js → openrouter-free-CvzSe3BV.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-LrcvpWsL.js → openrouter-oauth-D8bXl2G8.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Cdl39HR8.js → openrouter-oauth-D9dB7QjU.js} +1 -1
- package/dist/ui/assets/{opfs-mount-rptHafsX.js → opfs-mount-DBq0VsNB.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-BxI5qcWu.js → panel-rpc-handlers-BAG4GByh.js} +2 -2
- package/dist/ui/assets/{panelize-shell-BNYLPq0K.js → panelize-shell-DQppBxdS.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-u_54vGuq.js → pi-edit-execution-Cfj7bf30.js} +1 -1
- package/dist/ui/assets/{provider-dRR9ot_V.js → provider-CqeiAZ_G.js} +2 -2
- package/dist/ui/assets/{provider-DwQQd3sa.js → provider-YXNG6QPO.js} +1 -1
- package/dist/ui/assets/{provider-settings-Ddz2gd2I.js → provider-settings-CZImTHFG.js} +1 -1
- package/dist/ui/assets/provider-store-access-DKeg_RXv.js +1 -0
- package/dist/ui/assets/provider-store-access-L3uNVq58.js +1 -0
- package/dist/ui/assets/{providers-BXTsGY9I.js → providers-B0AOp8rr.js} +1 -1
- package/dist/ui/assets/{providers-027S5aj_.js → providers-CtQXQ4oW.js} +2 -2
- package/dist/ui/assets/{quick-llm-B_iH9qPz.js → quick-llm-3LrYftWl.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-B-CZOoke.js → realm-inprocess-DIjxEdem.js} +1 -1
- package/dist/ui/assets/{recovery-screen-CknTNXkR.js → recovery-screen-DNqRCbtR.js} +1 -1
- package/dist/ui/assets/{restore-CLont76_.js → restore-CZkqAzL2.js} +1 -1
- package/dist/ui/assets/{run-BNxiTd9h.js → run-9G65lfDK.js} +2 -2
- package/dist/ui/assets/{run-Df5ROlbZ.js → run-BIxAx-KH.js} +1 -1
- package/dist/ui/assets/{run-LczqCJD_.js → run-BhkbOV6R.js} +2 -2
- package/dist/ui/assets/{run-0R8uw6uS.js → run-C5t9mDWp.js} +2 -2
- package/dist/ui/assets/{run-CatN7ZRa.js → run-C7iJxQDT.js} +2 -2
- package/dist/ui/assets/{run-h8jT80HA.js → run-DlKyAoUE.js} +1 -1
- package/dist/ui/assets/{session-command-memory-CIDIVD5v.js → session-command-memory-CrLB7i0-.js} +2 -2
- package/dist/ui/assets/{session-jsonl-DSAJpXDL.js → session-jsonl-CmoHzpCV.js} +1 -1
- package/dist/ui/assets/{session-jsonl-odzc31-6.js → session-jsonl-DeMVYWQ_.js} +1 -1
- package/dist/ui/assets/{session-search-index-DDTPvT-k.js → session-search-index-_hPswg1g.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-MeL4yudo.js → setup-feature-flags-remote-Dp7nxMog.js} +1 -1
- package/dist/ui/assets/{signed-fetch-BlCl6D8B.js → signed-fetch-DQ-GTi8Q.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-BQ3A4bxx.js → silent-renew-backoff-CYG49bH_.js} +1 -1
- package/dist/ui/assets/slicc-version-C4IwD7mw.js +1 -0
- package/dist/ui/assets/{snapshot-C_ZrM9IB.js → snapshot-C3AulgRU.js} +1 -1
- package/dist/ui/assets/{snapshot-features-CDznwc6_.js → snapshot-features-5W_dp8YO.js} +1 -1
- package/dist/ui/assets/{soundscape-_4uQX_dL.js → soundscape-VzHK-TRd.js} +1 -1
- package/dist/ui/assets/{speak-CXJS0O-8.js → speak-BPE6nWri.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-7BSBAuC5.js → sprinkle-manager-BKY9d9I-.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-B7bwLA3p.js → sprinkle-renderer-Cj4U-mPb.js} +1 -1
- package/dist/ui/assets/{state-DctROffm.js → state-c6YssVcG.js} +1 -1
- package/dist/ui/assets/{store-B5-2jJGh.js → store-C6pBu_bl.js} +1 -1
- package/dist/ui/assets/{store-B06IcekE.js → store-Cu3zZiOq.js} +1 -1
- package/dist/ui/assets/{sudo-D9HKIX2e.js → sudo-CXYKa6m0.js} +1 -1
- package/dist/ui/assets/{supervisor-Dz1Fe3gq.js → supervisor-BjyyzOgG.js} +1 -1
- package/dist/ui/assets/{sync-dialog-Bsk5DV7A.js → sync-dialog-DXLAtyyl.js} +1 -1
- package/dist/ui/assets/{transformers-env-Cn7Lz8Ph.js → transformers-env-B29MZGe_.js} +1 -1
- package/dist/ui/assets/{tray-leader-B02TuNdM.js → tray-leader-DNJSVwRQ.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-D0gViiM5.js → tray-leave-runtime-B81L0J7_.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-BraOWdpK.js → tray-sidecar-D7lfz43I.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-oDQhNyoS.js → upgrade-detection-Dqwy5q0q.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-p8Q2LmQn.js → upskill-lick-skip-BqhnHW0T.js} +1 -1
- package/dist/ui/assets/{voice-reply-CytLb1zv.js → voice-reply-DXiOHTFD.js} +1 -1
- package/dist/ui/assets/{wc-attach-EpM5OpeC.js → wc-attach-C8ll-xn2.js} +2 -2
- package/dist/ui/assets/{wc-browser-BbkPuoxP.js → wc-browser-dbgIJZqT.js} +1 -1
- package/dist/ui/assets/{wc-computers-Bpz7H9hN.js → wc-computers-CPo7Ln-q.js} +1 -1
- package/dist/ui/assets/{wc-detached-CaK3NqPX.js → wc-detached-7JmuHMPw.js} +1 -1
- package/dist/ui/assets/{wc-extension-BiZJMn2A.js → wc-extension-BH3hBMXr.js} +2 -2
- package/dist/ui/assets/{wc-follower-I_3zaPgh.js → wc-follower-B_lsC8CG.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-CPdrmXpG.js → wc-follower-oauth-CiM6biTR.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-BbTkhIHa.js → wc-gelatiere-Bh9AMrX_.js} +1 -1
- package/dist/ui/assets/{wc-live-D-GZhpQG.js → wc-live-D2yEdN7K.js} +5 -5
- package/dist/ui/assets/{wc-nav-C1NlyPQj.js → wc-nav-BK3ESZcG.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-BT58iWuM.js → wc-onboarding-Dr4IX5NB.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-Bm6cT4_3.js → wc-placeholder-2RKT3vFq.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-DmJQQqLc.js → wc-secret-request-Ckb_em0N.js} +1 -1
- package/dist/ui/assets/{wc-settings-DZLBShM6.js → wc-settings-Ch9yOKj8.js} +3 -3
- package/dist/ui/assets/{wc-shell-Cy5Ntdih.js → wc-shell-Bkq7Nflp.js} +3 -3
- package/dist/ui/assets/{wc-shortcut-config-BGmHZpkc.js → wc-shortcut-config-DURxoa31.js} +1 -1
- package/dist/ui/assets/{wc-sprinkles-wvJoPFdx.js → wc-sprinkles-C7Z8Qe-6.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-Bnit5lqR.js → wc-transcript-export-iv4oLIe0.js} +2 -2
- package/dist/ui/assets/wc-tray-BwcKSzyP.js +5 -0
- package/dist/ui/assets/welcome-detection-BKCjoUeg.js +1 -0
- package/dist/ui/assets/{whisper-session-Cp0vp8Bt.js → whisper-session-wIp5X80N.js} +2 -2
- package/dist/ui/assets/{xai-grok-7B7FaBNj.js → xai-grok-DvyGJWVQ.js} +1 -1
- package/dist/ui/assets/{xai-grok-RDkLq0Xp.js → xai-grok-bxhpiLb-.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/memory-v2-flag-BVs23URW.js +0 -1
- package/dist/ui/assets/provider-store-access-CaBvayZN.js +0 -1
- package/dist/ui/assets/provider-store-access-Db83ANQj.js +0 -1
- package/dist/ui/assets/slicc-version-Cg_g6nqb.js +0 -1
- package/dist/ui/assets/wc-tray-DKPZJCpZ.js +0 -5
- package/dist/ui/assets/welcome-detection-Dh56tcLS.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-C_ZrM9IB.js";import{n as o,r as s}from"./panel-rpc-BPwAqRch.js";import{t as c}from"./providers-BXTsGY9I.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-D6AllWeO.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-BJLYDTCR.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-BlCl6D8B.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-DDjR1oFG.js";import{a as Ke}from"./tray-leader-status-CpkFr6n7.js";import{n as qe,t as Je}from"./slicc-version-Cg_g6nqb.js";import{a as Ye,i as Xe,o as Ze,r as x,t as Qe}from"./browser-DG5MjvHF.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-DZQVtgRS.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-oVgu4z70.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-DctROffm.js";import{a as $n,i as er,r as tr,t as nr}from"./git-config-Bdgu8kD2.js";import{a as rr,n as ir,o as ar,r as or,s as sr}from"./jsh-discovery-CnvNKojr.js";import{A as cr,C as lr,a as ur,b as dr,c as fr,d as pr,f as mr,h as hr,i as gr,j as _r,l as vr,m as yr,n as br,o as xr,p as Sr,r as Cr,s as wr,t as M,u as Tr,v as Er,y as Dr}from"./shared-C_68vn79.js";import{B as Or,F as kr,G as Ar,H as jr,J as Mr,K as Nr,L as Pr,N as Fr,P as Ir,U as Lr,V as Rr,W as zr,X as Br,Y as Vr,Z as Hr,q as Ur,z as Wr}from"./sync-sab-wire-CC30v4TL.js";import{n as Gr,t as Kr}from"./esbuild-wasm-DS_YG2EY.js";import{n as qr}from"./wasm-compiler-Ct7QZURL.js";import{a as Jr,o as Yr,s as Xr,t as Zr}from"./usb-device-registry-DFzxaOky.js";import{a as N,i as Qr,r as $r,t as ei}from"./just-bash-compat-B-SPHuh_.js";import{i as ti,r as ni,t as ri}from"./script-catalog-DZtOMxvi.js";import{a as ii,c as ai,o as oi,s as si,t as ci}from"./types-Dzr0qYl3.js";import{a as li,c as ui,d as di,f as fi,n as pi,r as mi,u as hi}from"./github-zip-DxtR21Uq.js";import{i as gi,t as _i}from"./github-auth-DgpIq4Vt.js";import{a as vi,i as yi,o as bi,r as xi,t as Si}from"./provenance-DdmsQ3Nr.js";import{a as Ci,c as wi,i as Ti,n as Ei,o as Di,r as Oi,s as ki}from"./github-install-DkISdZFD.js";import{n as Ai,t as ji}from"./magick-wasm-DCNZhAyd.js";import{i as Mi,n as Ni,r as Pi,t as Fi}from"./pdf-raster-BWk6ezTX.js";import{n as Ii}from"./lick-target-env-8JxfVcIV.js";import{t as Li}from"./tmpdir-env-ate4iNcK.js";import{a as Ri,c as zi,d as Bi,f as Vi,i as Hi,l as Ui,n as Wi,o as Gi,p as Ki,r as qi,s as Ji,t as Yi,u as Xi}from"./installer-DdsuEiHZ.js";import{t as Zi}from"./ffmpeg-wasm-B77gfnB_.js";import{t as Qi}from"./local-llm-BP3zyzsz.js";import{t as $i}from"./client-_vVqanZy.js";import{t as ea}from"./redirect-uri-D2aDPCyB.js";import{a as ta,c as na,i as ra,o as ia,r as aa,s as oa}from"./v86-vm-DCm7zA2r.js";import{n as sa,r as ca}from"./lick-urls-CgPiVwD-.js";let la=null;function ua(e){la=e!==null&&Number.isFinite(e)&&e>0?e:null}function da(){if(la!==null)return la;let e=globalThis.performance?.timeOrigin;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Date.now()}new URL(d).hostname;const fa=/^([0-9a-f]{32})--(?:[0-9a-f]{8}-)?([0-9a-f]+)$/i;function pa(e){let t;try{t=new URL(e.includes(`://`)?e:`https://${e}`).hostname}catch{return null}let n=fa.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 ma(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 ha(e,t){return e.some(e=>ma(e,t))}const ga=`slicc-transcript`,_a=[`canonical-agent-history-unavailable`,`tool-data-may-be-truncated`,`model-metadata-unavailable`,`scoop-history-unavailable`,`attachment-file-missing`,`attachment-association-unavailable`,`complete-snapshot-unavailable`],va=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 ya(e){return va.has(e.replace(/\/\d+(?=\/|$)/g,`/*`))}var ba=class extends Error{code;detail;constructor(e,t){super(t?`${e}: ${t}`:e),this.code=e,this.detail=t,this.name=`TranscriptExportError`}};const xa=new Set(_a),Sa=/^[0-9a-fA-F]{64}$/,Ca=/^\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 wa(e){return typeof e==`string`&&Sa.test(e)}function Ta(e){return Ca.test(e)&&Number.isFinite(Date.parse(e))}function Ea(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 Da(e,t,n){return typeof e!=`string`||!t.includes(e)?{ok:!1,error:Ea(n,t)}:{ok:!0}}function Oa(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 ka(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 Aa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Da(e.type,[`text`,`tool-call`,`attachment-ref`],`${t}.type`);return n.ok?ka(e,t):n}function ja(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 Ma(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 Na(e,t){let n=ja(e,t);if(!n.ok)return n;let r=e.cost;return P(r)?Ma(r,`${t}.cost`):{ok:!1,error:`${t}.cost must be a non-null object`}}function Pa(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`?Ta(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 Fa(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 Ia(e,t){let n=e.usage;return n===void 0?{ok:!0}:P(n)?Na(n,`${t}.usage`):{ok:!1,error:`${t}.usage must be a non-null object`}}function La(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Da(e.role,[`user`,`assistant`,`tool-result`],`${t}.role`);if(!n.ok)return n;if(e.role===`tool-result`){let n=Fa(e,t);if(!n.ok)return n}let r=Pa(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=Oa(i,Aa,`${t}.content`);return a.ok?Ia(e,t):a}function Ra(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=Da(e.kind,[`cone`,`scoop`],`${t}.kind`);if(!n.ok)return n;let r=e.messages;return Array.isArray(r)?Oa(r,La,`${t}.messages`):{ok:!1,error:`${t}.messages must be an array`}}function za(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 Ba(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`}:wa(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 Va=[`attachment-file-missing`,`attachment-association-unavailable`];function Ha(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?r===``?i===0?Da(e.missingReason,Va,`${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 Ua(e,t){return e.present?Ba(e,t):Ha(e,t)}function Wa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=za(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=Da(e.handling,[`text-redacted`,`binary-unchanged`],`${t}.handling`);return r.ok?Ua(e,t):r}function Ga(e,t){let n=Da(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 Ka(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=Da(e.detector,[`known-secret`,`credential-pattern`,`pre-obfuscated`],`${t}.detector`);if(!n.ok)return n;let r=e.target;return P(r)?Ga(r,`${t}.target`):{ok:!1,error:`${t}.target must be a non-null object`}}function qa(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 Ja(e,t){return typeof e!=`string`||!xa.has(e)?{ok:!1,error:`${t} is not a valid completeness reason`}:{ok:!0}}function Ya(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 Xa(e){if(!P(e))return{ok:!1,error:`session.completeness must be a non-null object`};let t=Da(e.status,[`complete`,`partial`],`session.completeness.status`);return t.ok?Array.isArray(e.missing)?Oa(e.missing,Ja,`session.completeness.missing`):{ok:!1,error:`session.completeness.missing must be an array`}:t}function Za(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=Da(e.state,[`active`,`frozen`],`session.state`);return t.ok?Xa(e.completeness):t}function Qa(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)?Oa(n,Ka,`privacy.redactions`):{ok:!1,error:`privacy.redactions must be an array`}}function $a(e){let t=e.conversations;if(!Array.isArray(t))return{ok:!1,error:`conversations must be an array`};let n=Oa(t,Ra,`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=Oa(r,qa,`delegations`);if(!i.ok)return i;let a=e.attachments;return Array.isArray(a)?Oa(a,Wa,`attachments`):{ok:!1,error:`attachments must be an array`}}function eo(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 to(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 no(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 ro(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 no(e))t.add(n)}return t}function io(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 ao(e){return io(e,ro(e))}function oo(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 so(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=oo(e,t);if(!r.ok)return r}}return{ok:!0}}function co(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return so(e,n)}function lo(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 uo(e,t){let n=lo(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 fo(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(no(e)))}return t}function po(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 mo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return po(e,n,fo(t))}function ho(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 go(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=ho(i,n,`privacy.redactions[${t}].target`);if(!a.ok)return a}return{ok:!0}}function _o(e){let t=e.conversations,n=e.attachments,r=e.delegations,i=e.privacy,a=Array.isArray(i?.redactions)?i.redactions:[],o=eo(t);if(!o.ok)return o;let s=to(t);if(!s.ok)return s;let c=ao(t);if(!c.ok)return c;let l=co(t,n);if(!l.ok)return l;let u=uo(n,t);if(!u.ok)return u;let d=mo(r,t);return d.ok?go(a,n):d}function vo(e){let t=$a(e);return t.ok?_o(e):t}function yo(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=Ya(e.export);if(!t.ok)return t;let n=Za(e.session);if(!n.ok)return n;let r=Qa(e.privacy);return r.ok?vo(e):r}async function bo(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:xo(a),sourceUrl:a}}function xo(e){if(!e)return`da`;let t;try{t=new URL(e).host}catch{return`da`}return t===`api.aem.live`?`aem`:`da`}const So=`slicc-sprinkle-routes`;function Co(){try{let e=localStorage.getItem(So);return e?JSON.parse(e):{}}catch{return{}}}function wo(e){try{localStorage.setItem(So,JSON.stringify(e))}catch{}}function To(e){return Co()[e]}function Eo(e,t){let n=Co();n[e]=t,wo(n)}function Do(e){let t=Co();delete t[e],wo(t)}function Oo(){return Co()}function ko(e,t,n){return dt(t,n,`${e} adapter does not implement ${t}.${n}`)}function Ao(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(ko(e,t,n))]});return{...Object.fromEntries(a),allowlist:i,supports:e=>i.includes(e)}}function jo(e){let{adapter:t,pageGestures:n}=e,r=n??{};return{adapter:t,browser:Ao(t,`browser`,mt,e.browser),network:Ao(t,`network`,ut,e.network),secrets:Ao(t,`secrets`,ht,e.secrets),devices:Ao(t,`devices`,gt,{usbRequest:r.usbRequest,serialRequest:r.serialRequest,hidRequest:r.hidRequest,...e.devices}),mounts:Ao(t,`mounts`,ft,{pickDirectory:r.pickDirectory,...e.mounts}),approvals:Ao(t,`approvals`,_t,e.approvals)}}function Mo(e={}){return jo({adapter:`connect`,pageGestures:e.pageGestures})}function No(e){let t=vt(()=>import(`./extension-ops-B2RMipFn.js`).then(t=>t.createExtensionOps(e)));return jo({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 Po(e={}){let t=vt(()=>import(`./rest-ops-aP40ni1y.js`).then(t=>t.createRestOps(e)),e.controlTimeoutMs??1e4);return jo({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 Fo(e,t={}){let{pageGestures:n}=t;switch(e){case`node-rest`:return Po({pageGestures:n});case`extension-direct`:case`extension-delegate`:return No({adapter:e,pageGestures:n});case`connect`:return Mo({pageGestures:n})}}const Io=e(`quick-llm`);async function Lo(e){let t=ee();if(!t)return Io.debug(`No API key for active provider — skipping`),null;let n=v(),r=_(),i;if(i=e.modelId?Vo(n,e.modelId)??Vo(n,r):Ro(n,r),!i)return Io.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`]=Ho());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 Io.debug(`Quick label call failed`,{error:e instanceof Error?e.message:String(e)}),null}}function Ro(e,t){let n=te(e);if(n.length===0)return;let r=n.find(e=>e.id===t)??n[0],i=Bo(r.id),a=n.filter(e=>zo(e,r,i));return a.length===0?r:(a.sort((e,t)=>(e.cost?.input??0)-(t.cost?.input??0)),a[0])}function zo(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 Bo(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 Vo(e,t){return te(e).find(e=>e.id===t)}function Ho(){return bt(`ui-quick-llm`)}const Uo=e(`sudo-suggest`),Wo=[`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-C3AulgRU.js";import{n as o,r as s}from"./panel-rpc-BPwAqRch.js";import{t as c}from"./providers-B0AOp8rr.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-D3tjNT4P.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-BJLYDTCR.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-DQ-GTi8Q.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-BRbIAzOE.js";import{a as Ke}from"./tray-leader-status-CpkFr6n7.js";import{n as qe,t as Je}from"./slicc-version-C4IwD7mw.js";import{a as Ye,i as Xe,o as Ze,r as x,t as Qe}from"./browser-DG5MjvHF.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-DZQVtgRS.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-N0yksfmJ.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-c6YssVcG.js";import{a as $n,i as er,r as tr,t as nr}from"./git-config-Bdgu8kD2.js";import{a as rr,n as ir,o as ar,r as or,s as sr}from"./jsh-discovery-CnvNKojr.js";import{A as cr,C as lr,a as ur,b as dr,c as fr,d as pr,f as mr,h as hr,i as gr,j as _r,l as vr,m as yr,n as br,o as xr,p as Sr,r as Cr,s as wr,t as M,u as Tr,v as Er,y as Dr}from"./shared-C_68vn79.js";import{B as Or,F as kr,G as Ar,H as jr,J as Mr,K as Nr,L as Pr,N as Fr,P as Ir,U as Lr,V as Rr,W as zr,X as Br,Y as Vr,Z as Hr,q as Ur,z as Wr}from"./sync-sab-wire-CC30v4TL.js";import{n as Gr,t as Kr}from"./esbuild-wasm-DS_YG2EY.js";import{n as qr}from"./wasm-compiler-Ct7QZURL.js";import{a as Jr,o as Yr,s as Xr,t as Zr}from"./usb-device-registry-DFzxaOky.js";import{a as N,i as Qr,r as $r,t as ei}from"./just-bash-compat-B-SPHuh_.js";import{i as ti,r as ni,t as ri}from"./script-catalog-DZtOMxvi.js";import{a as ii,c as ai,o as oi,s as si,t as ci}from"./types-Dzr0qYl3.js";import{a as li,c as ui,d as di,f as fi,n as pi,r as mi,u as hi}from"./github-zip-BIWI8hcq.js";import{i as gi,t as _i}from"./github-auth-Czxpk-jN.js";import{a as vi,i as yi,o as bi,r as xi,t as Si}from"./provenance-DdmsQ3Nr.js";import{a as Ci,c as wi,i as Ti,n as Ei,o as Di,r as Oi,s as ki}from"./github-install-pEVrJJeI.js";import{n as Ai,t as ji}from"./magick-wasm-DCNZhAyd.js";import{i as Mi,n as Ni,r as Pi,t as Fi}from"./pdf-raster-BWk6ezTX.js";import{n as Ii}from"./lick-target-env-8JxfVcIV.js";import{t as Li}from"./tmpdir-env-ate4iNcK.js";import{a as Ri,c as zi,d as Bi,f as Vi,i as Hi,l as Ui,n as Wi,o as Gi,p as Ki,r as qi,s as Ji,t as Yi,u as Xi}from"./installer-DyZaJqY0.js";import{t as Zi}from"./ffmpeg-wasm-B77gfnB_.js";import{t as Qi}from"./local-llm-BlMy0zGS.js";import{t as $i}from"./client-_vVqanZy.js";import{t as ea}from"./redirect-uri-D2aDPCyB.js";import{a as ta,c as na,i as ra,o as ia,r as aa,s as oa}from"./v86-vm-DCm7zA2r.js";import{n as sa,r as ca}from"./lick-urls-CgPiVwD-.js";let la=null;function ua(e){la=e!==null&&Number.isFinite(e)&&e>0?e:null}function da(){if(la!==null)return la;let e=globalThis.performance?.timeOrigin;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Date.now()}new URL(d).hostname;const fa=/^([0-9a-f]{32})--(?:[0-9a-f]{8}-)?([0-9a-f]+)$/i;function pa(e){let t;try{t=new URL(e.includes(`://`)?e:`https://${e}`).hostname}catch{return null}let n=fa.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 ma(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 ha(e,t){return e.some(e=>ma(e,t))}const ga=`slicc-transcript`,_a=[`canonical-agent-history-unavailable`,`tool-data-may-be-truncated`,`model-metadata-unavailable`,`scoop-history-unavailable`,`attachment-file-missing`,`attachment-association-unavailable`,`complete-snapshot-unavailable`],va=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 ya(e){return va.has(e.replace(/\/\d+(?=\/|$)/g,`/*`))}var ba=class extends Error{code;detail;constructor(e,t){super(t?`${e}: ${t}`:e),this.code=e,this.detail=t,this.name=`TranscriptExportError`}};const xa=new Set(_a),Sa=/^[0-9a-fA-F]{64}$/,Ca=/^\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 wa(e){return typeof e==`string`&&Sa.test(e)}function Ta(e){return Ca.test(e)&&Number.isFinite(Date.parse(e))}function Ea(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 Da(e,t,n){return typeof e!=`string`||!t.includes(e)?{ok:!1,error:Ea(n,t)}:{ok:!0}}function Oa(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 ka(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 Aa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Da(e.type,[`text`,`tool-call`,`attachment-ref`],`${t}.type`);return n.ok?ka(e,t):n}function ja(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 Ma(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 Na(e,t){let n=ja(e,t);if(!n.ok)return n;let r=e.cost;return P(r)?Ma(r,`${t}.cost`):{ok:!1,error:`${t}.cost must be a non-null object`}}function Pa(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`?Ta(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 Fa(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 Ia(e,t){let n=e.usage;return n===void 0?{ok:!0}:P(n)?Na(n,`${t}.usage`):{ok:!1,error:`${t}.usage must be a non-null object`}}function La(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=Da(e.role,[`user`,`assistant`,`tool-result`],`${t}.role`);if(!n.ok)return n;if(e.role===`tool-result`){let n=Fa(e,t);if(!n.ok)return n}let r=Pa(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=Oa(i,Aa,`${t}.content`);return a.ok?Ia(e,t):a}function Ra(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=Da(e.kind,[`cone`,`scoop`],`${t}.kind`);if(!n.ok)return n;let r=e.messages;return Array.isArray(r)?Oa(r,La,`${t}.messages`):{ok:!1,error:`${t}.messages must be an array`}}function za(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 Ba(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`}:wa(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 Va=[`attachment-file-missing`,`attachment-association-unavailable`];function Ha(e,t){let n=e.path,r=e.sha256,i=e.byteLength;return n===``?r===``?i===0?Da(e.missingReason,Va,`${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 Ua(e,t){return e.present?Ba(e,t):Ha(e,t)}function Wa(e,t){if(!P(e))return{ok:!1,error:`${t} must be a non-null object`};let n=za(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=Da(e.handling,[`text-redacted`,`binary-unchanged`],`${t}.handling`);return r.ok?Ua(e,t):r}function Ga(e,t){let n=Da(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 Ka(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=Da(e.detector,[`known-secret`,`credential-pattern`,`pre-obfuscated`],`${t}.detector`);if(!n.ok)return n;let r=e.target;return P(r)?Ga(r,`${t}.target`):{ok:!1,error:`${t}.target must be a non-null object`}}function qa(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 Ja(e,t){return typeof e!=`string`||!xa.has(e)?{ok:!1,error:`${t} is not a valid completeness reason`}:{ok:!0}}function Ya(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 Xa(e){if(!P(e))return{ok:!1,error:`session.completeness must be a non-null object`};let t=Da(e.status,[`complete`,`partial`],`session.completeness.status`);return t.ok?Array.isArray(e.missing)?Oa(e.missing,Ja,`session.completeness.missing`):{ok:!1,error:`session.completeness.missing must be an array`}:t}function Za(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=Da(e.state,[`active`,`frozen`],`session.state`);return t.ok?Xa(e.completeness):t}function Qa(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)?Oa(n,Ka,`privacy.redactions`):{ok:!1,error:`privacy.redactions must be an array`}}function $a(e){let t=e.conversations;if(!Array.isArray(t))return{ok:!1,error:`conversations must be an array`};let n=Oa(t,Ra,`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=Oa(r,qa,`delegations`);if(!i.ok)return i;let a=e.attachments;return Array.isArray(a)?Oa(a,Wa,`attachments`):{ok:!1,error:`attachments must be an array`}}function eo(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 to(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 no(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 ro(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 no(e))t.add(n)}return t}function io(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 ao(e){return io(e,ro(e))}function oo(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 so(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=oo(e,t);if(!r.ok)return r}}return{ok:!0}}function co(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return so(e,n)}function lo(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 uo(e,t){let n=lo(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 fo(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(no(e)))}return t}function po(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 mo(e,t){let n=new Set;for(let e of t)P(e)&&typeof e.id==`string`&&n.add(e.id);return po(e,n,fo(t))}function ho(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 go(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=ho(i,n,`privacy.redactions[${t}].target`);if(!a.ok)return a}return{ok:!0}}function _o(e){let t=e.conversations,n=e.attachments,r=e.delegations,i=e.privacy,a=Array.isArray(i?.redactions)?i.redactions:[],o=eo(t);if(!o.ok)return o;let s=to(t);if(!s.ok)return s;let c=ao(t);if(!c.ok)return c;let l=co(t,n);if(!l.ok)return l;let u=uo(n,t);if(!u.ok)return u;let d=mo(r,t);return d.ok?go(a,n):d}function vo(e){let t=$a(e);return t.ok?_o(e):t}function yo(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=Ya(e.export);if(!t.ok)return t;let n=Za(e.session);if(!n.ok)return n;let r=Qa(e.privacy);return r.ok?vo(e):r}async function bo(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:xo(a),sourceUrl:a}}function xo(e){if(!e)return`da`;let t;try{t=new URL(e).host}catch{return`da`}return t===`api.aem.live`?`aem`:`da`}const So=`slicc-sprinkle-routes`;function Co(){try{let e=localStorage.getItem(So);return e?JSON.parse(e):{}}catch{return{}}}function wo(e){try{localStorage.setItem(So,JSON.stringify(e))}catch{}}function To(e){return Co()[e]}function Eo(e,t){let n=Co();n[e]=t,wo(n)}function Do(e){let t=Co();delete t[e],wo(t)}function Oo(){return Co()}function ko(e,t,n){return dt(t,n,`${e} adapter does not implement ${t}.${n}`)}function Ao(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(ko(e,t,n))]});return{...Object.fromEntries(a),allowlist:i,supports:e=>i.includes(e)}}function jo(e){let{adapter:t,pageGestures:n}=e,r=n??{};return{adapter:t,browser:Ao(t,`browser`,mt,e.browser),network:Ao(t,`network`,ut,e.network),secrets:Ao(t,`secrets`,ht,e.secrets),devices:Ao(t,`devices`,gt,{usbRequest:r.usbRequest,serialRequest:r.serialRequest,hidRequest:r.hidRequest,...e.devices}),mounts:Ao(t,`mounts`,ft,{pickDirectory:r.pickDirectory,...e.mounts}),approvals:Ao(t,`approvals`,_t,e.approvals)}}function Mo(e={}){return jo({adapter:`connect`,pageGestures:e.pageGestures})}function No(e){let t=vt(()=>import(`./extension-ops-B2RMipFn.js`).then(t=>t.createExtensionOps(e)));return jo({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 Po(e={}){let t=vt(()=>import(`./rest-ops-aP40ni1y.js`).then(t=>t.createRestOps(e)),e.controlTimeoutMs??1e4);return jo({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 Fo(e,t={}){let{pageGestures:n}=t;switch(e){case`node-rest`:return Po({pageGestures:n});case`extension-direct`:case`extension-delegate`:return No({adapter:e,pageGestures:n});case`connect`:return Mo({pageGestures:n})}}const Io=e(`quick-llm`);async function Lo(e){let t=ee();if(!t)return Io.debug(`No API key for active provider — skipping`),null;let n=v(),r=_(),i;if(i=e.modelId?Vo(n,e.modelId)??Vo(n,r):Ro(n,r),!i)return Io.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`]=Ho());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 Io.debug(`Quick label call failed`,{error:e instanceof Error?e.message:String(e)}),null}}function Ro(e,t){let n=te(e);if(n.length===0)return;let r=n.find(e=>e.id===t)??n[0],i=Bo(r.id),a=n.filter(e=>zo(e,r,i));return a.length===0?r:(a.sort((e,t)=>(e.cost?.input??0)-(t.cost?.input??0)),a[0])}function zo(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 Bo(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 Vo(e,t){return te(e).find(e=>e.id===t)}function Ho(){return bt(`ui-quick-llm`)}const Uo=e(`sudo-suggest`),Wo=[`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
|
`),Go=[`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 Ko(e,t){if(e.suggestedPattern&&e.suggestedPattern.trim().length>0)return e.suggestedPattern.trim();let n=e.detail.trim(),r=e.kind===`command`?Wo:Go,i=null;try{i=await Lo({prompt:n,system:r,maxTokens:40,temperature:0,signal:t})}catch(e){Uo.debug(`suggestPattern: quickLabel threw`,{error:e instanceof Error?e.message:String(e)}),i=null}return qo(i)||n}function qo(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 Jo=e(`sudo:capability-gesture`);function Yo(e,t={}){let n=t.suggest??Ko;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 Jo.warn(`sudo approval aborted before prompting — denying`,{detail:t.detail}),{decision:`deny`};if(!e)return Jo.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):(Jo.warn(`capability broker approvals.request failed — denying`,{message:o.message}),{decision:`deny`})}}}const Xo=e(`sudo:tray-first`);function Zo(e,t={}){let n=t.suggest??Ko,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){Xo.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 Qo(e?.decision,o)}catch(e){Xo.warn(`tray-first sudo probe failed — using native broker`,{error:e instanceof Error?e.message:String(e)})}return e.requestApproval(s,a)}}}function Qo(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 $o(e,t){return{requestApproval(n){return t.enqueueSudoRequest(e,n)}}}function es(){return`lick-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}var ts=class{pending=new Map;timeoutMs;newId;setTimer;clearTimer;onAutoSettle;constructor(e={}){this.timeoutMs=e.timeoutMs??3e5,this.newId=e.newId??es,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 ns(e){return ct(rs(e))}function rs(e){let t=Yo(e);return e?.adapter===`extension-direct`||e?.adapter===`extension-delegate`?t:Zo(t)}let is=null;function as(e){return is=e,()=>{is===e&&(is=null)}}function os(){if(!is)throw new ba(`session-not-found`);return is}const ss=`focus`,cs={type:`leaf`,surfaceId:`chat`};function ls(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 us={focus:{name:`focus`,tree:ls({left:cs},{left:3,middle:1})}};function ds(e){return us[e]??null}const fs=`progress`;function ps(e){return/^[A-Za-z_][A-Za-z0-9_]*$/.test(e)}const ms=e(`mount-picker-popup`),hs=6e4;function gs(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}),hs);Bt(`directory`,[],t,{timeoutMs:hs}).then(e=>{let n=e;if(n.error){ms.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=>{ms.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 _s(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=()=>{ms.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 vs(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 ys(){try{let e=await gs();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 _s(e.idbKey);if(!t)throw Error(`mount: no directory handle found in storage`);return await vs(t),t}throw Error(`mount: unexpected popup result`)}catch(e){throw Error(`mount: ${e instanceof Error?e.message:String(e)}`)}}async function bs(){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 xs(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 Ss(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 Cs=new Set([`--source`,`--profile`,`--backend`,`--max-body-mb`]);function ws(e){for(let t=0;t<e.length;t++){let n=e[t];if(n===`--`)return!1;if(n===`--help`||n===`-h`)return!0;Cs.has(n)&&t++}return!1}function Ts(e){return`aem://${e.org}/${e.name}${e.path?`/${e.path}`:``}`}var Es=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=xs(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 Ds(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 ys():await bs();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=Ss(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 bo(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`?Ts(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(ws(e))return n===`umount`?this.umountHelp():this.help();let r=xs(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
|
|
@@ -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-xwj5OOqP.js`).then(e=>e.n);try{switch(r){case`list`:return Wm(t,e,i,n.env.get(`PATH`));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:Hm(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 Km=[{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=>Ti(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 qm(e){let t={skills:[],dryRun:!1,json:!1};for(let n=0;n<e.length;n++){let r=e[n],i=Km.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 Jm(e,t){return!e||!t||e.byteLength!==t.byteLength?!1:e.every((e,n)=>e===t[n])}async function Ym(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 Xm(e,t,n,r){let i=await Ym(e,t);return di(n)?i?{status:`kept-local`,write:!1}:{status:`added`,write:!0}:i?Jm(i,r)?{status:`unchanged`,write:!1}:{status:`updated`,write:!0}:{status:`added`,write:!0}}async function Zm(e,t,n,r){let i={changes:[],writes:[],removals:[]};for(let[r,a]of n){let n=`${t}/${r}`,{status:o,write:s}=await Xm(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 fi(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 Qm(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 _i(t),d=await yi(s,c,o.ref,u,!0,l||void 0);if(d&&r.sha===d&&await $m(e,n,r))return{...o,to:d,outcome:`current`,changes:[]};let f=await eh(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 Zm(e,`${ii}/${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 ah(e,{changes:h,writes:g,removals:_}),await bi(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 $m(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 eh(e,t,n,r,i,a,o){let s=await mi(e,t,a,i??`main`);if(s.status===`ok`){let i=li(s.files),a=n||th(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:ih(i,a),path:a}}try{return{files:rh(nh(await pi(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 th(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 nh(e){return new Map([...e].filter(([e])=>ui(e)))}function rh(e){return new Map([...e].sort(([e],[t])=>e.localeCompare(t)))}function ih(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);ui(e)&&r.set(e,i)}return rh(r)}async function ah(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 oh(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 Lm(o,s,t);if(!c.ok)return{...a,outcome:`error`,error:c.error};let l=`${ii}/${n}/SKILL.md`,u=await Ym(e,l),d=new TextEncoder().encode(c.content),f=u!==void 0&&Fm(new TextDecoder().decode(u))===Fm(c.content);if(Jm(u,d)||f)return{...a,changes:[{path:`SKILL.md`,status:`unchanged`}]};let p=u?`updated`:`added`;return i||(await e.mkdir(`${ii}/${n}`,{recursive:!0}),await e.writeFile(l,d),await bi(e,n,{...r,files:[`SKILL.md`]})),{...a,outcome:`updated`,changes:[{path:`SKILL.md`,status:p}]}}function sh(e,t){if(e.outcome===`error`)return` ${e.skill}: failed — ${e.error}\n`;let n=new Map;for(let t of e.changes)n.set(t.status,(n.get(t.status)??0)+1);let r=e.to&&e.to!==e.from?` → ${e.to.slice(0,7)}`:``;if(e.outcome===`current`)return` ${e.skill}: already current (${e.source}${r})\n`;let i=t?`would update`:`updated`,a=` ${e.skill}: ${i} from ${e.source}${r}\n`;for(let t of e.changes)t.status!==`unchanged`&&(a+=` ${t.status.padEnd(10)} ${t.path}\n`);let o=n.get(`kept-local`)??0;return o>0&&(a+=` (${o} kept-local — dotfiles and local additions are never touched)\n`),a}function ch(e,t,n,r){let i=Ti(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 lh(e,t,n){if(t.length===0){let t=await vi(e);return{targets:t.provenanced,missing:[],skipped:t.unattributed}}let r=[],i=[];for(let a of t){let t=await xi(e,a);if(t){r.push({name:a,provenance:t});continue}if(!await e.exists(`/workspace/skills/${a}`)){i.push({name:a,reason:`not-installed`});continue}let o=n.from?ch(a,n.from,n.path,n.branch):null;o?r.push({name:a,provenance:o}):i.push({name:a,reason:`no-provenance`})}return{targets:r,missing:i,skipped:[]}}function uh(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 ph(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+=sh(n,t);if(i.length>0&&(a+=fh(i)),!n&&r&&e.length>0){let n=i.length>0?`all ${dh(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 mh(e,t,n){let{targets:r,missing:i,skipped:a}=await lh(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 oh(e,t,i.name,i.provenance,n.dryRun):await Qm(e,t,i.name,i.provenance,n.branch,n.dryRun));return{results:o,skipped:a,missing:i}}async function hh(e,t,n){let r=qm(e);if(r.error)return{stdout:``,stderr:`${r.error}\n`,exitCode:1};let{results:i,missing:a,skipped:o}=await mh(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`:ph([],r.dryRun,!1,!0,o),stderr:``,exitCode:0}:{stdout:``,stderr:a.length?a.map(uh).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 wi();let l=a.map(uh).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:ph(i,r.dryRun,c,u,o),stderr:l,exitCode:+!u}}function gh(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 _h(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 vh(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}${_h(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 yh(e,t,n){let r=await(await import(`./kernel-worker-
|
|
289
|
+
`)}\n`}async function yh(e,t,n){let r=await(await import(`./kernel-worker-xwj5OOqP.js`).then(e=>e.n)).discoverSkills(e),{collisions:i}=await or(e,rr(n));return t?{stdout:`${JSON.stringify({ok:!0,skills:r,commandCollisions:i})}\n`,stderr:``,exitCode:0}:r.length===0?{stdout:`No discoverable local skills found.\n\n${zm()}`,stderr:``,exitCode:0}:{...sr(`upskill`,Vm(r,`Discoverable local skills`),i,{builtinNames:new Set(Ze())}),exitCode:0}}async function bh(e,t,n){let{results:r,skipped:i}=await mh(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:vh(r,i),stderr:c,exitCode:+!s}}async function xh(e,t,n,r){let i=gh(e);return i.error?{stdout:``,stderr:`${i.error}\n`,exitCode:1}:i.outdated?bh(t,n,i.json):yh(t,i.json,r)}async function Sh(e,t){let n=`${ai}/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(gi(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=Ci(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 Ch(e,t){let n=`${ai}/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: ${gi(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=Ci(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 wh=[{label:`Tessl`,host:new URL(ai).host,fetch:Sh},{label:`browse.sh`,host:new URL(ci).host,fetch:km}];function Th(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 Eh(e,t,n=1){let r=await Promise.allSettled(wh.map(n=>n.fetch(e,t))),i=r.map(e=>e.status===`fulfilled`?e.value:[]),a=r.every(e=>e.status===`rejected`),o=Th(i),s=``;for(let e=0;e<r.length;e++){let t=r[e];if(t.status===`rejected`){let n=wh[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 Nh(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 Ph(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=Nh(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 Fh(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=Nh(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 Fh(e,t,n){if(!t)return{stdout:``,stderr:`upskill: ${e} requires a skill name\n`,exitCode:1};let r=await import(`./kernel-worker-xwj5OOqP.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 xi(n,t),a=i?Si(i):"Installed from: (no provenance recorded — reinstall to enable `upskill update`)\n";return{stdout:Hm(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 Ih(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 Di(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 Lh(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 Ei(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 Rh(e,t,n,r,i,a,o,s){let c=``,l=``,u=0;for(let d of e){let e=await Ei(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 zh(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 Bh(e,t,n,r){let{owner:i,repo:a}=e,o=t.branch??e.branch,s=t.subPath??e.path,c=await _i(r),l=await Oi(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:zh(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:zh(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 mi(i,a,r,o);if(e.status===`ok`){let r=await yi(i,a,o,c,!0,s),l=await Ih(u,i,a,li(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 Lh(u,i,a,c,n,t.force,o,f);({output:p,errors:m,successCount:h}=e)}}else({output:p,errors:m,successCount:h}=await Rh(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 wi()),{stdout:p,stderr:m,exitCode:+!!m}}async function Vh(e,t,n,r,i){switch(e[0]){case`tabs`:return jh(t,n,r,e.includes(`--json`));case`recommendations`:return Mh(t,n,e.includes(`--install`));case`update`:case`upgrade`:return hh(e.slice(1),t,n);case`list`:return xh(e.slice(1),t,n,i);case`info`:case`read`:return Fh(e[0],e[1],t);case`search`:return Uh(e,n);default:return null}}function Hh(e,t,n){return x(`upskill`,async(r,i)=>{if(r.length===0||r.includes(`--help`)||r.includes(`-h`))return Um();let a=await Vh(r,e,t,n,i.env.get(`PATH`));if(a)return a;let o=Ph(r);if(o.earlyReturn)return o.earlyReturn;if(!o.sourceRef)return Um();if(o.sourceRef.startsWith(`tessl:`))return Wh(o.sourceRef,o.force,e,t);let s=Mm(o.sourceRef);if(s)return Rm(s.hostname,s.task,e,t,o.force);let c=Ti(o.sourceRef);return c?Bh(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 Uh(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?Eh(a,t,i):Um()}async function Wh(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 Ch(i,r);if(`error`in a)return{stdout:``,stderr:`upskill: ${a.error}\n`,exitCode:1};let o=await _i(r);return Ei(a.owner,a.repo,a.skillPath,a.skillName,n,o,t,r)}function Gh(){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 ty(e,t){let n=S(e.slice(1),{});if(`error`in n)return Qv(n.error);if(!t()){let e=await Gv();if(!e)return Jv(`list`);let t=await e.listCronTasks();return t.length===0?{stdout:`No active cron tasks
|
|
705
705
|
`,stderr:``,exitCode:0}:{stdout:ey(t),stderr:``,exitCode:0}}let{ok:r,data:i}=await Xv(`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:ey(a),stderr:``,exitCode:0}}async function ny(e,t){let n=e[0],r=S(e.slice(1),{});if(`error`in r)return Qv(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 Gv();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}:Jv(`delete`)}let{ok:a,status:o,data:s}=await Xv(`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 ry(e={}){let t=e.hasLocalNodeServer??(()=>!1);return x(`crontask`,async(e,n)=>{let r=e[0];if(!r||C(e,{valueFlags:Zv}))return Yv();try{switch(r){case`create`:return await $v(e,n.env,t);case`list`:return await ty(e,t);case`delete`:case`kill`:return await ny(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 iy(e){return x(`curlwright`,async(t,n)=>{let{runCurlwright:r}=await import(`./run-
|
|
706
|
+
`,stderr:``,exitCode:0}:{stdout:ey(a),stderr:``,exitCode:0}}async function ny(e,t){let n=e[0],r=S(e.slice(1),{});if(`error`in r)return Qv(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 Gv();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}:Jv(`delete`)}let{ok:a,status:o,data:s}=await Xv(`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 ry(e={}){let t=e.hasLocalNodeServer??(()=>!1);return x(`crontask`,async(e,n)=>{let r=e[0];if(!r||C(e,{valueFlags:Zv}))return Yv();try{switch(r){case`create`:return await $v(e,n.env,t);case`list`:return await ty(e,t);case`delete`:case`kill`:return await ny(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 iy(e){return x(`curlwright`,async(t,n)=>{let{runCurlwright:r}=await import(`./run-BIxAx-KH.js`);return r(e,t,n)})}const ay=`slicc-fs`;async function oy(){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===ay)}catch{return!0}}async function sy(){let e=globalThis.indexedDB;return e?new Promise(t=>{let n;try{n=e.deleteDatabase(ay)}catch{t(`error`);return}n.onsuccess=()=>t(`deleted`),n.onerror=()=>t(`error`),n.onblocked=()=>t(`blocked`)}):`error`}async function cy(){if(!await oy())return{kind:`absent`,message:`legacy slicc-fs IDB not present — nothing to clean`};let e=await sy();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 ly(){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 iS(e);case`delete`:return aS(e);case`create`:return await cS(e,t.env);default:return nS(`unknown command: ${n}`)}})}function uS(e){return x(`gelatiere`,async(t,n)=>{let{runGelatiere:r}=await import(`./run-
|
|
914
|
+
`);switch(n){case`list`:return iS(e);case`delete`:return aS(e);case`create`:return await cS(e,t.env);default:return nS(`unknown command: ${n}`)}})}function uS(e){return x(`gelatiere`,async(t,n)=>{let{runGelatiere:r}=await import(`./run-9G65lfDK.js`);return r(t,n,e)})}function dS(e){return typeof e.stdoutIsTTY!=`boolean`||e.stdoutIsTTY}function fS(e,t){return typeof e.stdinIsTTY==`boolean`?e.stdinIsTTY:t===void 0?Qr(e.stdin).length===0:t===0}function pS(){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 zw(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 Bw(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 Vw(e,t,n){await zw(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 Hw(){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 Hw(){return import(`./snapshot-features-5W_dp8YO.js`)}async function Uw(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 Ww(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`,tT],[`state-load`,nT],[`console`,FS],[`requests`,Cw],[`request`,ww],[`request-headers`,Tw],[`request-body`,Ew],[`response-headers`,Dw],[`response-body`,Ow],[`mousemove`,DC],[`mousedown`,OC],[`mouseup`,kC],[`mousewheel`,AC],[`drop`,jC],[`route`,Iw],[`route-list`,Lw],[`unroute`,Rw],[`generate-locator`,GS],[`highlight`,KS]]);function TT(){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 ET(e){return e.map(e=>e===`--no-iframes`||e.startsWith(`--no-iframes=`)?e.replace(`--no-iframes`,`--_noiframes`):e)}function DT(e){return{...e,bool:[...e.bool??[],`--_noiframes`],value:[...e.value??[],`--_noiframes`]}}const OT=2e3;function kT(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 AT(e,t,n,r){if(!t||typeof e.getTabLockStats!=`function`)return r;let i=e.getTabLockStats(),a=i.totalWaitMs-t.totalWaitMs;if(a<OT)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>=OT?`${(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 jT(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 MT(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 NT(e,t,n){let r=wT.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?MT(e,t,void 0):a}catch(r){return i?.aborted?MT(e,t,r):await jT(n.browser,n.flags,r)}}async function PT(e,t,n,r){let i=S(ET(n),DT(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 jT(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 MT(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 NT(e,t,n){let r=wT.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?MT(e,t,void 0):a}catch(r){return i?.aborted?MT(e,t,r):await jT(n.browser,n.flags,r)}}async function PT(e,t,n,r){let i=S(ET(n),DT(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-CBbczzoA.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 FT(e,t,n){let r=t?zn(t,n):null,i=TT();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-CBbczzoA.js`);return{stdout:t(e)+`
|
|
1278
1278
|
`,stderr:``,exitCode:0}}let s=a[0],c=a.slice(1),l=await PT(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=kT(t,f),m=await NT(e,s,{browser:t,fs:n,state:r,positional:u,flags:d,scratchDir:Li(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 Bw(t,n,h,r));try{await Vw(n,r,{command:s,args:c,result:m,snapshotPath:g,targetId:h})}catch{}return AT(t,p,f,m)})}const IT=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)`,[...Ag]]]);function LT(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 IT){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 nO(e,t){let n=await e.readFile(t);return typeof n==`string`?n:new TextDecoder().decode(n)}async function rO(e,t){try{return(await e.stat(t)).type===`file`}catch{return!1}}async function iO(e,t){try{return(await e.stat(t)).type===`directory`}catch{return!1}}function*aO(e,t=!1){if(t){yield cr;return}let n=y(e);for(;yield b(n,`node_modules`),n!==`/`;)n=Ee(n).dir;yield cr}async function oO(e,t,n,r=!1){for(let i of aO(t,r)){let t=b(i,`.bin`,n);if(!await rO(e,t))continue;let r=await nO(e,t),a=eO.exec(r),o=Ee(t).dir;return{binFilePath:a?b(o,a[1]):t,argvName:t}}return null}function sO(e){if(e.startsWith(`@`)){let t=e.indexOf(`/`);if(t!==-1)return e.slice(t+1)}return e}function cO(e,t){if(typeof e==`string`)return{binName:sO(t),binPath:e};if(typeof e!=`object`||!e)return null;let n=[t,sO(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 lO(e,t,n,r=!1){for(let i of aO(t,r)){let t=b(i,n),r=b(t,`package.json`);if(!await rO(e,r))continue;let a;try{a=JSON.parse(await nO(e,r))}catch{return null}let o=cO(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 uO(e,t,n,r=!1){return await oO(e,t,n,r)??await lO(e,t,n,r)}async function dO(e,t,n){for(let r of aO(t))if(await rO(e,b(r,n,`package.json`)))return!0;return!1}function fO(e){return e instanceof Error?e.message:String(e)}function pO(e,t){return{stdout:``,stderr:`${e}: ${t}\n`,exitCode:1}}async function mO(e,t,n,r){try{let i=await qi([t],{fs:r.fs,fetch:r.fetch,cwd:n.cwd});if(i.errors.length>0)return{error:pO(e,`failed to install '${t}': ${fO(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:pO(e,`failed to install '${t}': ${fO(n)}`)}}}async function hO(e,t,n,r){return await rO(r,n)?null:await iO(r,n)?pO(e,`bin target '${n}' is a directory, not a file`):pO(e,`bin file '${n}' for '${t}' does not exist`)}async function gO(e,t,n,r,i,a){if(await dO(a.fs,i.cwd,t))return{error:pO(e,`package '${t}' does not expose an executable bin`)};let o=r?void 0:ZD(t);if(o)return{error:{stdout:``,stderr:$D(e,t,n,o),exitCode:1}};let s=await mO(e,t,i,a);if(`error`in s)return s;let c=await uO(a.fs,i.cwd,t);return c?{resolved:c,installProgress:s.progress}:{error:pO(e,`package '${t}' was installed but does not expose an executable bin`)}}function _O(e,t){return{name:e,trusted:!0,async execute(n,r){if(n.length===0||n[0]===`--help`||n[0]===`-h`)return{stdout:tO(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:tO(e),stderr:``,exitCode:1};let c=s[0],l=s.slice(1),u;try{u=await uO(t.fs,r.cwd,c,o)}catch(t){return pO(e,fO(t))}let d=``;if(!u){if(o)return pO(e,`no global bin '${c}' found in ${cr}`);let n=await gO(e,c,l,i,r,t);if(`error`in n)return n.error;u=n.resolved,d=n.installProgress}let f=await hO(e,c,u.binFilePath,t.fs);if(f)return f;let p=wt(await nO(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 vO(e={}){return x(`jshd`,async(t,n)=>{let{runJshd:r}=await import(`./run-
|
|
1462
|
+
`)}\n`:``}}catch(n){return{error:pO(e,`failed to install '${t}': ${fO(n)}`)}}}async function hO(e,t,n,r){return await rO(r,n)?null:await iO(r,n)?pO(e,`bin target '${n}' is a directory, not a file`):pO(e,`bin file '${n}' for '${t}' does not exist`)}async function gO(e,t,n,r,i,a){if(await dO(a.fs,i.cwd,t))return{error:pO(e,`package '${t}' does not expose an executable bin`)};let o=r?void 0:ZD(t);if(o)return{error:{stdout:``,stderr:$D(e,t,n,o),exitCode:1}};let s=await mO(e,t,i,a);if(`error`in s)return s;let c=await uO(a.fs,i.cwd,t);return c?{resolved:c,installProgress:s.progress}:{error:pO(e,`package '${t}' was installed but does not expose an executable bin`)}}function _O(e,t){return{name:e,trusted:!0,async execute(n,r){if(n.length===0||n[0]===`--help`||n[0]===`-h`)return{stdout:tO(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:tO(e),stderr:``,exitCode:1};let c=s[0],l=s.slice(1),u;try{u=await uO(t.fs,r.cwd,c,o)}catch(t){return pO(e,fO(t))}let d=``;if(!u){if(o)return pO(e,`no global bin '${c}' found in ${cr}`);let n=await gO(e,c,l,i,r,t);if(`error`in n)return n.error;u=n.resolved,d=n.installProgress}let f=await hO(e,c,u.binFilePath,t.fs);if(f)return f;let p=wt(await nO(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 vO(e={}){return x(`jshd`,async(t,n)=>{let{runJshd:r}=await import(`./run-BhkbOV6R.js`);return r(t,n,e)})}const yO=new Set([`SIGINT`,`SIGTERM`,`SIGKILL`,`SIGSTOP`,`SIGCONT`]);function bO(e={}){return x(`kill`,async t=>{if(t.length===0||t.includes(`--help`)||t.includes(`-h`))return EO();let n=e.processManager??xO();if(!n)return{stdout:``,stderr:`kill: no process manager available in this runtime
|
|
1463
1463
|
`,exitCode:1};let r=SO(t);if(!r.ok)return{stdout:``,stderr:r.stderr,exitCode:r.exitCode};let{allDelivered:i,errors:a}=CO(n,r.pids,r.signal);return{stdout:``,stderr:a.length?`${a.join(`
|
|
1464
1464
|
`)}\n`:``,exitCode:+!i}})}function xO(){let e=globalThis.__slicc_pm;return e instanceof Object&&typeof e.signal==`function`?e:null}function SO(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=wO(n);if(i instanceof Error)return{ok:!1,stderr:`kill: ${i.message}\n`,exitCode:2};t=i;continue}if(i.startsWith(`-`)){let e=TO(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 $O(e,t){let n=t.models.length;return{stdout:[`✓ ${e} (${YO(t.runtime,!1)})`,` Saved ${n} model${n===1?``:`s`} to Settings:`,...XO(t.models)].join(`
|
|
1534
1534
|
`)+`
|
|
1535
|
-
`,stderr:``,exitCode:0}}function ek(){return x(qO,async e=>{if(e.includes(`--help`)||e.includes(`-h`))return{stdout:JO(),stderr:``,exitCode:0};let{getApiKeyForProvider:t,getRawApiKeyForProvider:n,getBaseUrlForProvider:r,addAccount:i}=await import(`./account-store-
|
|
1535
|
+
`,stderr:``,exitCode:0}}function ek(){return x(qO,async e=>{if(e.includes(`--help`)||e.includes(`-h`))return{stdout:JO(),stderr:``,exitCode:0};let{getApiKeyForProvider:t,getRawApiKeyForProvider:n,getBaseUrlForProvider:r,addAccount:i}=await import(`./account-store-D3tjNT4P.js`).then(e=>e.t),{verifyConnection:a}=await import(`./local-llm-BlMy0zGS.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(qO);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(qO)??void 0);if(!c.ok)return ZO(s,c);if(o===`discover`){let e=n(qO)??``;return i(qO,e,s,c.models.join(`, `)),$O(s,c)}return QO(s,c)})}function tk(){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 sk(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 sk(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-Cu3zZiOq.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 dk(r,i,e.resourceMetadataUrl,t),l=new s({url:r,fetchImpl:t.fetchImpl,getAuthHeader:()=>Bk(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 Gk(i,t);let m=await Jk(i,f,t);if(u){let{registerMcpProvider:e}=await import(`./provider-YXNG6QPO.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: ${ok}/${i}.jsh`,u?` auth: oauth (provider mcp:${i})`:` auth: none`].join(`
|
|
1574
1574
|
`)+`
|
|
1575
|
-
`)}async function dk(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 sk(n.error);let{ensureAllMcpProvidersRegistered:r}=await import(`./provider-
|
|
1575
|
+
`)}async function dk(e,t,n,r){let{discoverAuth:i,dynamicRegister:a,runAuthFlow:o}=await import(`./oauth-DR6XMm1M.js`),{saveOAuthAccount:s}=await import(`./account-store-D3tjNT4P.js`).then(e=>e.t),c=await Hk(r.oauthFetchImpl),l=r.oauthLauncher??await Vk(),u=await i(e,n,c);ak.debug(`MCP OAuth discovery succeeded`,{name:t,serverUrl:e,discoveryPath:u.discoveryPath,issuer:u.issuer});let d=await ea(_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 fk(e,t){if(C(e))return U(`usage: mcp list
|
|
1576
|
+
`);let n=S(e,{});if(`error`in n)return sk(n.error);let{ensureAllMcpProvidersRegistered:r}=await import(`./provider-YXNG6QPO.js`);await r();let{listServers:i}=await import(`./store-Cu3zZiOq.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(pk(s))}function pk(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 mk(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 sk(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 sk(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 sk(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-YXNG6QPO.js`);await a();let{listServers:o}=await import(`./store-Cu3zZiOq.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,hk(e.description),e.match]);return U(pk(u))}function hk(e){if(!e)return``;let t=e.replace(/\s+/g,` `).trim();return t.length<=60?t:t.slice(0,59)+`…`}async function gk(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 sk(n.error);let r=n.positionals[0];if(!r)return W(`mcp delete: expected <name>`);let{ensureMcpProviderRegistered:i,removeMcpProvider:a}=await import(`./provider-YXNG6QPO.js`);await i(r);let{deleteServer:o}=await import(`./store-Cu3zZiOq.js`).then(e=>e.r),s=await o(r,t.fs);await Kk(r,t),await qk(r,t);let c=`mcp:${r}`,l=!1;try{let{removeAccount:e,getAccounts:t}=await import(`./account-store-D3tjNT4P.js`).then(e=>e.t);t().some(e=>e.providerId===c)&&(await e(c),l=!0)}catch(e){ak.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 _k(e,t){if(e.length===0)return W(`mcp invoke: expected <name>`);if(C(e.slice(0,1)))return U(bk());let n=S([e[0]],{});if(`error`in n)return sk(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 _k(e,t){if(e.length===0)return W(`mcp invoke: expected <name>`);if(C(e.slice(0,1)))return U(bk());let n=S([e[0]],{});if(`error`in n)return sk(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-YXNG6QPO.js`);await a(r);let{getServer:o}=await import(`./store-Cu3zZiOq.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(xk(r,s,c));let l=S([i[0]],{});if(`error`in l)return sk(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}=vk(i.slice(1));if(C(p))return U(Ck(r,d));let h=wk(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?()=>Bk(r):void 0,...f===void 0?{}:{timeoutMs:f}});await _.initialize();let v=Ik(await _.toolsCall(u,h.value));return m.length>0&&(v.stderr=m.map(e=>`${e}\n`).join(``)+v.stderr),v}function vk(e){let t=[],n=[],r,i=0;for(;i<e.length;){let a=e[i];if(a.startsWith(`--timeout=`)){let e=yk(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=yk(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 yk(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 bk(){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 sk(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 sk(n.error);let r=n.positionals[0];if(!r)return W(`mcp refresh: expected <name>`);let{ensureMcpProviderRegistered:i}=await import(`./provider-YXNG6QPO.js`);await i(r);let{getServer:a,setServer:o}=await import(`./store-Cu3zZiOq.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?()=>Bk(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 Jk(r,f,t);return U(`Refreshed "${r}" — tools: ${d.length}, apps: ${f.length} (${p} sprinkle${p===1?``:`s`})\n`)}async function Rk(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:ik});if(`error`in n)return sk(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:ik});if(`error`in n)return sk(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-YXNG6QPO.js`),s=await o(r,{fetchImpl:t.oauthFetchImpl,launcher:t.oauthLauncher}),{getServer:c}=await import(`./store-Cu3zZiOq.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-B0AOp8rr.js`).then(e=>e.r),f=d(u);if(!f)return W(`mcp auth: provider "${u}" is not registered`);if(a)return await zk(r,f,t);if(!f.onSilentRenew)return i?W(`mcp auth: provider "${u}" does not support silent renewal; retry without --silent`):await zk(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`);ak.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 zk(r,f,t)}async function zk(e,t,n){if(!t.onOAuthLogin)return W(`mcp auth: provider "${t.id}" does not support interactive OAuth login`);let r=n.oauthLauncher??await Vk(),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 Bk(e){let t=`mcp:${e}`,{getOAuthAccountInfo:n}=await import(`./account-store-D3tjNT4P.js`).then(e=>e.t),r=n(t);if(!r)return null;if(r.expired){try{let{getRegisteredProviderConfig:e}=await import(`./providers-B0AOp8rr.js`).then(e=>e.r),n=await e(t)?.onSilentRenew?.();if(n)return`Bearer ${n}`}catch(e){ak.debug(`silent renewal threw`,{providerId:t,error:e instanceof Error?e.message:String(e)})}return null}return`Bearer ${r.token}`}async function Vk(){let{createOAuthLauncher:e}=await import(`./oauth-service-CRmx6zI1.js`);return e()}async function Hk(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 Uk(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-BRbIAzOE.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 Wk(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 Gk(e,t){let n=await Uk(t.fs);await n.mkdir(ok,{recursive:!0}),await n.writeFile(`${ok}/${e}.jsh`,Wk(e)),t.scriptCatalog?.invalidateJsh()}async function Kk(e,t){let n=await Uk(t.fs),r=`${ok}/${e}.jsh`;try{await n.exists(r)&&await n.rm(r)}catch(e){ak.debug(`alias removal failed`,{path:r,error:e instanceof Error?e.message:String(e)})}t.scriptCatalog?.invalidateJsh()}async function qk(e,t){let{removeAppSprinkles:n}=await import(`./apps-
|
|
1660
|
+
`}async function Gk(e,t){let n=await Uk(t.fs);await n.mkdir(ok,{recursive:!0}),await n.writeFile(`${ok}/${e}.jsh`,Wk(e)),t.scriptCatalog?.invalidateJsh()}async function Kk(e,t){let n=await Uk(t.fs),r=`${ok}/${e}.jsh`;try{await n.exists(r)&&await n.rm(r)}catch(e){ak.debug(`alias removal failed`,{path:r,error:e instanceof Error?e.message:String(e)})}t.scriptCatalog?.invalidateJsh()}async function qk(e,t){let{removeAppSprinkles:n}=await import(`./apps-DPLWQsL8.js`);await n(e,t.fs)}async function Jk(e,t,n){try{let{materializeAppSprinkles:r}=await import(`./apps-DPLWQsL8.js`);return(await r(e,t,n.fs)).length}catch(t){return ak.warn(`mcp: failed to materialize app sprinkles`,{name:e,error:t instanceof Error?t.message:String(t)}),0}}function Yk(e){return{stdout:``,stderr:`meminfo: ${e}\n`,exitCode:1}}function Xk(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 Zk(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 Qk(){let e=globalThis.performance,t=e?.measureUserAgentSpecificMemory;return t?t.bind(e):null}function $k(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 eA(e){let t=[`total: ${Xk(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(`${Xk(e.bytes).padEnd(10)} ${e.types.join(`,`).padEnd(20)} ${Zk(e)}`)}return`${t.join(`
|
|
1661
1661
|
`)}\n`}function tA(e={}){return x(`meminfo`,async t=>{let n=$k(t);if(`error`in n)return Yk(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??Qk();if(!r&&!e.measure)return Yk(`memory measurement requires a cross-origin-isolated runtime (Document-Isolation-Policy) — this runtime is not isolated`);if(!i)return Yk(`performance.measureUserAgentSpecificMemory is not available in this browser`);let a;try{a=await i()}catch(e){return Yk(e instanceof Error?e.message:String(e))}return n.json?{stdout:`${JSON.stringify(a,null,2)}\n`,stderr:``,exitCode:0}:{stdout:eA(a),stderr:``,exitCode:0}})}function nA(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??Qk();if(!r&&!e.measure)return Yk(`memory measurement requires a cross-origin-isolated runtime (Document-Isolation-Policy) — this runtime is not isolated`);if(!i)return Yk(`performance.measureUserAgentSpecificMemory is not available in this browser`);let a;try{a=await i()}catch(e){return Yk(e instanceof Error?e.message:String(e))}return n.json?{stdout:`${JSON.stringify(a,null,2)}\n`,stderr:``,exitCode:0}:{stdout:eA(a),stderr:``,exitCode:0}})}function nA(e){return x(`memory`,async t=>{let{runMemory:n}=await import(`./run-C7iJxQDT.js`);return n(t,e)})}function rA(){return x(`mktemp`,async(e,t)=>{let{runMktemp:n}=await import(`./run-dAJe7sKp.js`);return n(e,t)})}const iA=`/.cache/artificial-analysis.json`,aA=[`--all`,`--all-versions`,`--json`,`--refresh`,`--no-benchmarks`,`--help`,`-h`],oA=[`--provider`];function sA(e){return{stdout:``,stderr:e.endsWith(`
|
|
1673
1673
|
`)?e:`${e}\n`,exitCode:1}}async function cA(e){try{let t=await e.readFile(iA),n=JSON.parse(t);if(Date.now()-n.fetchedAt<864e5)return n.models}catch{}return null}function lA(){try{return localStorage.getItem(`aa_api_key`)}catch{return null}}function uA(e){return e.map(e=>{let t=e;return{slug:t.slug??``,name:t.name??``,creator_slug:t.model_creator?.slug??``,intelligence_index:t.evaluations?.artificial_analysis_intelligence_index??null,coding_index:t.evaluations?.artificial_analysis_coding_index??null,speed_tps:t.median_output_tokens_per_second??null}})}async function dA(e,t){let n={fetchedAt:Date.now(),models:t};try{await e.mkdir(`/.cache`,{recursive:!0}),await e.writeFile(iA,JSON.stringify(n))}catch{}}async function fA(e,t=!1){if(e&&!t){let t=await cA(e);if(t)return t}let n={Accept:`application/json`},r=lA();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=uA(Array.isArray(s)?s:s.data??s.models??[]);return e&&c.length>0&&await dA(e,c),c}function pA(e){return e.toLowerCase().replace(/\./g,`-`).replace(/-\d{8}$/,``).replace(/-\d{4}$/,``)}function mA(e,t){let n=e.toLowerCase(),r=t.find(e=>e.slug===n);if(r)return r;let i=pA(e),a=t.find(e=>pA(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 hA(){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 gA(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`.replace(`.0M`,`M`):e>=1e3?`${(e/1e3).toFixed(0)}K`:`${e}`}function _A(e){return`$${e.toFixed(2)}`}const vA=/\b(embedding|embed|tts|whisper|dall-e|image-gen|audio|vision-preview)\b/i;function yA(e){let t=`${e.id} ${e.name??``}`;return!vA.test(t)}function bA(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 xA(e){let t=e.toLowerCase();return t=t.replace(/-\d{8}$/,``),t=t.replace(/-\d{4}$/,``),t=t.replace(/-(preview|latest)$/,``),bA(t)??t.replace(/-[\d.]+$/,``)}function SA(e){let t=new Map;for(let n of e){let e=xA(n.id);(!t.has(e)||n.selected)&&t.set(e,n)}return[...t.values()]}function CA(e,t,n,r,i){let a=i?mA(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 wA(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=`${_A(e.cost.input)} / ${_A(e.cost.output)}`,a=`${gA(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 TA(e){let t=S(e,{bool:aA,value:oA});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 EA(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 DA(e,t,n,r,i,a){let o=e.getProviderModels(t).filter(yA);if(o.length===0)return[];let s=o.map(e=>CA(e,t,n,r,i)).sort((e,t)=>t.cost.input-e.cost.input);return a||(s=SA(s)),s}function OA(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 kA(e,t){if(C(e,{valueFlags:oA}))return{stdout:hA(),stderr:``,exitCode:0};let n=TA(e);if(`error`in n)return sA(`models: ${n.error}`);let r=await import(`./account-store-
|
|
1687
|
+
`}function TA(e){let t=S(e,{bool:aA,value:oA});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 EA(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 DA(e,t,n,r,i,a){let o=e.getProviderModels(t).filter(yA);if(o.length===0)return[];let s=o.map(e=>CA(e,t,n,r,i)).sort((e,t)=>t.cost.input-e.cost.input);return a||(s=SA(s)),s}function OA(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 kA(e,t){if(C(e,{valueFlags:oA}))return{stdout:hA(),stderr:``,exitCode:0};let n=TA(e);if(`error`in n)return sA(`models: ${n.error}`);let r=await import(`./account-store-D3tjNT4P.js`).then(e=>e.t);if(r.getAccounts().length===0)return sA(`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 fA(t,n.forceRefresh);e.length>0&&(l=e)}let u=EA(r,n,s);if(`error`in u)return sA(u.error);let d=[],f=[];for(let e of u){let t=DA(r,e,a,o,l,n.allVersions);if(t.length===0){if(!n.allMode)return sA(`No models available for provider ${e}.\n`);continue}if(d.push(...t),!n.jsonMode){let n=r.getProviderConfig(e);f.push(wA(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(OA(o,a,s,c)),{stdout:f.join(`
|
|
@@ -1742,7 +1742,7 @@ Examples:
|
|
|
1742
1742
|
`)}\n`,stderr:``,exitCode:0}}async function ej(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 tj(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 nj(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 rj(e,t,n,r){switch(t){case`list`:return $A(e,n);case`add`:return ej(e,n,r);case`remove`:return tj(e,n,r);case`clear`:return nj(e,n);default:return{stdout:``,stderr:`oauth-domain: unknown subcommand "${t}"\n${ZA()}`,exitCode:1}}}function ij(){return x(`oauth-domain`,async e=>{if(e.length===0||C(e))return{stdout:ZA(),stderr:``,exitCode:0};let t=S(e);if(`error`in t)return QA(t.error);let[n,r,i]=t.positionals,a=await import(`./account-store-
|
|
1745
|
+
`,exitCode:1}}async function rj(e,t,n,r){switch(t){case`list`:return $A(e,n);case`add`:return ej(e,n,r);case`remove`:return tj(e,n,r);case`clear`:return nj(e,n);default:return{stdout:``,stderr:`oauth-domain: unknown subcommand "${t}"\n${ZA()}`,exitCode:1}}}function ij(){return x(`oauth-domain`,async e=>{if(e.length===0||C(e))return{stdout:ZA(),stderr:``,exitCode:0};let t=S(e);if(`error`in t)return QA(t.error);let[n,r,i]=t.positionals,a=await import(`./account-store-D3tjNT4P.js`).then(e=>e.t);try{return await rj(a,n,r,i)}catch(e){return QA(e instanceof Error?e.message:String(e))}})}function aj(){return x(`oauth-token`,async(e,t)=>{let{runOAuthToken:n}=await import(`./run-C5t9mDWp.js`);return n(e,t)})}const oj=[`--download`,`-d`,`--view`,`-v`],sj=[`--size`],cj={low:256,medium:768,high:1536};function lj(){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 fr(t.fs,i?e:xr(e)),o=Hr(e,a),s;try{s=await r(o)}catch(e){return G(`${e instanceof Error?e.message:String(e)}\n`)}return vj(`opened ${e} → ${o}${yj(s)}`)}async function Ej(e,t,n,r){if(!mr(e)&&e.endsWith(`.shtml`)&&t.fs)return xj(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(mr(e))return Sj(e,r.canOpenWindow,r.openExternal);let i=t.fs.resolvePath(t.cwd,e);return n.view?Cj(e,i,t,n.sizeSpec):n.download?wj(e,i,t,r.hasDom):Tj(i,t,r.canOpenWindow,r.openExternal)}function Dj(e){return x(`open`,async(t,n)=>{if(t.length===0||C(t,{valueFlags:sj}))return lj();let r=_j(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 lj();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:bj(e,u,d)},p=[];for(let e of c){let t=await Ej(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 Oj(){return x(`patch`,async(e,t)=>{let{runPatch:n}=await import(`./run-
|
|
1771
|
+
`,stderr:``,exitCode:0}})}function Oj(){return x(`patch`,async(e,t)=>{let{runPatch:n}=await import(`./run-DlKyAoUE.js`);return n(e,t)})}function kj(e=`pdftk`){return x(e,async(t,n)=>{let{runPdftk:r}=await import(`./run-BEs473Sp.js`);return r(e,t,n)})}function Aj(){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 qj(e={}){return x(`plugin`,async(t,n)=>{if(t.length===0||t[0]===`--help`||t[0]===`-h`)return Wj(Kj());let r=t[0],i=t.slice(1),a=n?.cwd??`/`;try{switch(r){case`install`:case`add`:return await eM(i,a,e);case`list`:case`ls`:return await iM(i,e);case`info`:return await aM(i,e);case`validate`:return await oM(i,a,e,Li(n?.env));case`remove`:case`rm`:case`delete`:return await sM(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 Jj(e){if(e.fs)return e.fs;let{VirtualFS:t}=await import(`./fs-
|
|
1831
|
+
`}function qj(e={}){return x(`plugin`,async(t,n)=>{if(t.length===0||t[0]===`--help`||t[0]===`-h`)return Wj(Kj());let r=t[0],i=t.slice(1),a=n?.cwd??`/`;try{switch(r){case`install`:case`add`:return await eM(i,a,e);case`list`:case`ls`:return await iM(i,e);case`info`:return await aM(i,e);case`validate`:return await oM(i,a,e,Li(n?.env));case`remove`:case`rm`:case`delete`:return await sM(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 Jj(e){if(e.fs)return e.fs;let{VirtualFS:t}=await import(`./fs-BRbIAzOE.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 Yj(e,t,n){let r=cM(t,e);if(await n.exists(r))return{kind:`local`,root:r};let{parseGitHubRef:i}=await import(`./github-install-pEVrJJeI.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 Xj(e){let t=e.replace(/[^A-Za-z0-9._-]+/g,`-`);return/^\.+$/.test(t)?t.replace(/\./g,`_`):t}function Zj(e){let t=[e.owner,e.repo,...e.path?[e.path]:[]];return`${Uj}/${t.map(Xj).join(`--`)}`}async function Qj(e,t,n,r){let{fetchRepoZip:i,stripZipPrefix:a,writeZipFilesToDir:o}=await import(`./github-zip-BIWI8hcq.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 $j(e,t){try{await e.rm(t,{recursive:!0})}catch{}}async function eM(e,t,n){if(C(e))return Wj(`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=Gj(`install`,e);if(!(`ok`in r))return r;if(r.positionals.length<1)return K(`plugin install: expected <path|repo>`);let i=await Jj(n),a=await Yj(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=Zj(a.ref),s=a.ref.display;let e=await Qj(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 $j(i,o),K(`plugin install: plugin at ${s??o} was rejected:\n${lM(l.diagnostics)}`);let{plugin:u}=l,d=u.manifest.name,{getInstalledPlugin:f,setInstalledPlugin:p}=await import(`./store-
|
|
1842
|
+
`);let r=Gj(`install`,e);if(!(`ok`in r))return r;if(r.positionals.length<1)return K(`plugin install: expected <path|repo>`);let i=await Jj(n),a=await Yj(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=Zj(a.ref),s=a.ref.display;let e=await Qj(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 $j(i,o),K(`plugin install: plugin at ${s??o} was rejected:\n${lM(l.diagnostics)}`);let{plugin:u}=l,d=u.manifest.name,{getInstalledPlugin:f,setInstalledPlugin:p}=await import(`./store-C6pBu_bl.js`),m=await f(d,n.fs);if(m&&m.root!==o)return a.kind===`github`&&await $j(i,o),K(`plugin install: a plugin named "${d}" is already installed from ${m.root} (remove it first)`);let h=await rM(u,n),g=await nM(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),Wj(tM(u,h,g,s??o,l.diagnostics))}function tM(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:`,lM(i)),c.join(`
|
|
1843
1843
|
`)+`
|
|
1844
|
-
`}async function nM(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=Gj(`list`,e);if(!(`ok`in n))return n;let{listInstalledPlugins:r}=await import(`./store-
|
|
1844
|
+
`}async function nM(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-Cu3zZiOq.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 rM(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-Cu3zZiOq.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 iM(e,t){if(C(e))return Wj(`usage: plugin list
|
|
1845
|
+
`);let n=Gj(`list`,e);if(!(`ok`in n))return n;let{listInstalledPlugins:r}=await import(`./store-C6pBu_bl.js`),i=await r(t.fs),a=Object.keys(i).sort();if(a.length===0)return Wj("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 Wj(o.map(e=>e.map((e,t)=>e.padEnd(s[t])).join(` `)).join(`
|
|
1846
1846
|
`)+`
|
|
1847
1847
|
`)}async function aM(e,t){if(C(e))return Wj(`usage: plugin info <name>
|
|
1848
|
-
`);let n=Gj(`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=Gj(`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-C6pBu_bl.js`),a=await i(r,t.fs);if(!a)return K(`plugin info: no installed plugin named "${r}"`);let o=await Jj(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${lM(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:`,lM(c.diagnostics)),Wj(d.join(`
|
|
1849
1849
|
`)+`
|
|
1850
1850
|
`)}async function oM(e,t,n,r){if(C(e))return Wj(`usage: plugin validate <path|repo>
|
|
1851
1851
|
`);let i=Gj(`validate`,e);if(!(`ok`in i))return i;if(i.positionals.length<1)return K(`plugin validate: expected <path|repo>`);let a=await Jj(n),o=await Yj(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/${Zj(o.ref).split(`/`).pop()}`;let e=await Qj(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 $j(a,c)}if(!u.ok)return{stdout:``,stderr:`plugin validate: REJECTED\n${lM(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:`,lM(u.diagnostics)),Wj(p.join(`
|
|
1852
1852
|
`)+`
|
|
1853
1853
|
`)}async function sM(e,t){if(C(e))return Wj(`usage: plugin remove <name>
|
|
1854
|
-
`);let n=Gj(`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=Gj(`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-C6pBu_bl.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-Cu3zZiOq.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(`${Uj}/`);return c&&await $j(await Jj(t),o.root),Wj([`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 cM(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 lM(e){return e.map(e=>` ${e.level===`error`?`error`:`warn `} [${e.component}] ${e.message}`).join(`
|
|
1857
1857
|
`)}const uM=[`pid`,`ppid`,`kind`,`stat`,`start`,`scoop`,`command`],dM=[`pid`,`ppid`,`stat`,`start`,`scoop`,`command`],fM={running:`R`,pending:`S`,exited:`Z`,killed:`K`},pM=[`-a`,`-A`,`-e`,`--all`,`-T`,`--tree`],mM=[`-o`,`--columns`];function hM(e={}){return x(`ps`,async t=>{if(C(t,{valueFlags:mM}))return DM();let n=e.processManager??gM();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 LP(e,t,n){if(e.ttlMs!==void 0){if(!t)throw Error(`persistent snapshot filesystem unavailable`);return kP(t,n)}}async function RP(e,t,n,r){if(e.length===0||e.includes(`--help`)||e.includes(`-h`))return pP();let i=yP(e);if(i.error)return{stdout:``,stderr:i.error,exitCode:1};let a=await FP(i);if(a)return a;if(!i.directory)return pP();let o=IP(i);if(o)return o;let s=await bP(i.directory,i.entry,t.fs,t.cwd);if(xP(s))return s;let{fullDirectory:c,entryPath:l}=s,u;try{u=await LP(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 NP(!i.noBridge&&i.bridge,d);return f.ok?PP(i,c,l,f.webhookId,d,u,n):f.result}function zP(e,t){return x(`serve`,(n,r)=>RP(n,r,e,t))}const BP=`usage: session export [--id <id>] [--output <path>]
|
|
2058
|
-
`;function VP(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 HP(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${BP}`};let n=r[e+1];if(!n||n.startsWith(`-`))return{ok:!1,stderr:`session export: --id requires a value\n${BP}`};t=n,e++}else if(i===`--output`){if(n!==null)return{ok:!1,stderr:`session export: duplicate flag --output\n${BP}`};let t=r[e+1];if(!t||t.startsWith(`-`))return{ok:!1,stderr:`session export: --output requires a path\n${BP}`};n=t,e++}else if(i.startsWith(`-`))return{ok:!1,stderr:`session export: unknown flag ${i}\n${BP}`};else return{ok:!1,stderr:`session export: unexpected argument ${JSON.stringify(i)}\n${BP}`}}return{ok:!0,args:{sessionId:t,outputPath:n}}}async function UP(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 ba(`transfer-corrupt`);return r}async function WP(e,t){let n=HP(e);if(!n.ok)return{stdout:``,stderr:n.stderr,exitCode:1};let{sessionId:r,outputPath:i}=n.args;if(i!==null){let e=VP(i);if(!e.ok)return{stdout:``,stderr:`session export: --output ${e.reason}\n${BP}`,exitCode:1}}let a=r==null?{kind:`active`}:{kind:`frozen`,sessionId:r};try{let e=await os().export(a,{}),n=await UP(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 ba?e.code:e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function GP(){return x(`session`,async(e,t)=>{if(e[0]===`export`&&!C(e))return WP(e,t);let{dispatchSessionMemoryAware:n}=await import(`./session-command-memory-
|
|
2058
|
+
`;function VP(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 HP(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${BP}`};let n=r[e+1];if(!n||n.startsWith(`-`))return{ok:!1,stderr:`session export: --id requires a value\n${BP}`};t=n,e++}else if(i===`--output`){if(n!==null)return{ok:!1,stderr:`session export: duplicate flag --output\n${BP}`};let t=r[e+1];if(!t||t.startsWith(`-`))return{ok:!1,stderr:`session export: --output requires a path\n${BP}`};n=t,e++}else if(i.startsWith(`-`))return{ok:!1,stderr:`session export: unknown flag ${i}\n${BP}`};else return{ok:!1,stderr:`session export: unexpected argument ${JSON.stringify(i)}\n${BP}`}}return{ok:!0,args:{sessionId:t,outputPath:n}}}async function UP(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 ba(`transfer-corrupt`);return r}async function WP(e,t){let n=HP(e);if(!n.ok)return{stdout:``,stderr:n.stderr,exitCode:1};let{sessionId:r,outputPath:i}=n.args;if(i!==null){let e=VP(i);if(!e.ok)return{stdout:``,stderr:`session export: --output ${e.reason}\n${BP}`,exitCode:1}}let a=r==null?{kind:`active`}:{kind:`frozen`,sessionId:r};try{let e=await os().export(a,{}),n=await UP(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 ba?e.code:e instanceof Error?e.message:String(e)}\n`,exitCode:1}}}function GP(){return x(`session`,async(e,t)=>{if(e[0]===`export`&&!C(e))return WP(e,t);let{dispatchSessionMemoryAware:n}=await import(`./session-command-memory-CrLB7i0-.js`);return n(e,t,BP)})}function KP(){return x(`slicc`,async(e,t)=>{let{runSlicc:n}=await import(`./run-CreCrLyX.js`);return await n(e,t)})}const qP=`leader`;function JP(){try{let e=globalThis.localStorage?.getItem(`slicc.leaderSprinkleInstances`);if(e)return JSON.parse(e)}catch{}return[]}function YP(e){return+!!e.leader+e.followers.length}function XP(){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
|