sliccy 6.240.0 → 6.240.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/.vite/manifest.json +215 -213
- package/dist/ui/assets/{account-store-Dcuv1CAr.js → account-store-BZBj_ntG.js} +1 -1
- package/dist/ui/assets/{account-store-Co7p6uLK.js → account-store-DkttH-BP.js} +1 -1
- package/dist/ui/assets/{adobe-DScuixZ8.js → adobe-ByBtC69J.js} +1 -1
- package/dist/ui/assets/{adobe-C8D8r5Fe.js → adobe-CVqQJ2x-.js} +1 -1
- package/dist/ui/assets/{agent-panels-O5YJfC1_.js → agent-panels-BVpX6zQ5.js} +1 -1
- package/dist/ui/assets/{almost-bash-shell-headless-C4AVF2S6.js → almost-bash-shell-headless-HOeKQtgA.js} +499 -499
- package/dist/ui/assets/{apply-layout-BZ9iuS4D.js → apply-layout-C_O6ndKr.js} +1 -1
- package/dist/ui/assets/{azure-openai-jPUEdFGb.js → azure-openai-DiqKGUYo.js} +1 -1
- package/dist/ui/assets/{azure-openai-DGNroO-7.js → azure-openai-Z4aqtv7E.js} +1 -1
- package/dist/ui/assets/{cdp-DfHqMmOw.js → cdp-D0OuKYd5.js} +1 -1
- package/dist/ui/assets/{cerebras-DJsSEczS.js → cerebras-6-gk1Jha.js} +1 -1
- package/dist/ui/assets/{cerebras--GK0UhYQ.js → cerebras-UwtUgOV6.js} +1 -1
- package/dist/ui/assets/{composer-speech-Bdzozil9.js → composer-speech-QgsQ1IqW.js} +1 -1
- package/dist/ui/assets/{connect-surface-BQ_yaiI0.js → connect-surface-COrO1h1v.js} +1 -1
- package/dist/ui/assets/context-compaction-BCsq-2e6.js +58 -0
- package/dist/ui/assets/core-BFRZk2b-.js +62 -0
- package/dist/ui/assets/{core-C1m4D34S.js → core-EGZ5TU35.js} +1 -1
- package/dist/ui/assets/{directed-approval-CM6zsUB_.js → directed-approval-iMn6w3M8.js} +1 -1
- package/dist/ui/assets/{emscripten-vfs-hook-BykczwZL.js → emscripten-vfs-hook-_WoXADPd.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-DHqVNK3z.js → frozen-archive-writer-BhgsVjoX.js} +1 -1
- package/dist/ui/assets/{frozen-archive-writer-BoBWoTrh.js → frozen-archive-writer-CBS7YWrT.js} +1 -1
- package/dist/ui/assets/{frozen-session-delete-CmVE8uz7.js → frozen-session-delete-B1-ipujg.js} +1 -1
- package/dist/ui/assets/{frozen-session-identity-ChrV93y5.js → frozen-session-identity-CTAIleP4.js} +1 -1
- package/dist/ui/assets/{frozen-session-identity-CRTDWmSN.js → frozen-session-identity-EbIVZuRz.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-Dnug4wB5.js → gelatiere-unit-BE-OCtHt.js} +1 -1
- package/dist/ui/assets/{github-DBHS2Dqt.js → github-C1OAynaV.js} +1 -1
- package/dist/ui/assets/{github-B2Jmtl5T.js → github-Dhh_Kein.js} +1 -1
- package/dist/ui/assets/{github-copilot-Cb-AGqlO.js → github-copilot-BECMsi8_.js} +1 -1
- package/dist/ui/assets/{github-copilot-jU2_bitu.js → github-copilot-Hlw3Z0TU.js} +1 -1
- package/dist/ui/assets/{guest-tool-gate-CXdRgkkb.js → guest-tool-gate-83ZVVYjM.js} +1 -1
- package/dist/ui/assets/{hear-C8rKY1FP.js → hear-B0sL5R-Z.js} +1 -1
- package/dist/ui/assets/{idle-compaction-pwltoPDa.js → idle-compaction-DGln8tkz.js} +1 -1
- package/dist/ui/assets/{interrupted-work-recovery-DSX617ic.js → interrupted-work-recovery-CWSaMQsO.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-kX5NT2rg.js → js-realm-worker-lw4jlVws.js} +2 -2
- package/dist/ui/assets/{jsh-executor-BVRmWOcY.js → jsh-executor-DZkflzRL.js} +2 -2
- package/dist/ui/assets/{kernel-worker-B8dQ6oD2.js → kernel-worker-yDR9ykP9.js} +78 -78
- package/dist/ui/assets/{lick-ws-bridge-xmS7PfYb.js → lick-ws-bridge-D_7Sju9n.js} +1 -1
- package/dist/ui/assets/{lick-ws-bridge-B55KMh7y.js → lick-ws-bridge-awVQ4bod.js} +1 -1
- package/dist/ui/assets/{live-session-curation-BNMM5Cko.js → live-session-curation-KCnMJq1h.js} +1 -1
- package/dist/ui/assets/live-session-curation-XtShh6w8.js +186 -0
- package/dist/ui/assets/{live-session-snapshot-BW_iWuYO.js → live-session-snapshot-Cl5CEBKO.js} +1 -1
- package/dist/ui/assets/{local-llm-BTE5kJfp.js → local-llm-BuO74RMi.js} +1 -1
- package/dist/ui/assets/{local-llm-CJUTJaEr.js → local-llm-gJaQCXGv.js} +1 -1
- package/dist/ui/assets/main-CvCAlghs.js +22 -0
- package/dist/ui/assets/{main-cherry-Oc5q4aB-.js → main-cherry-C829SF3P.js} +1 -1
- package/dist/ui/assets/{mcp-command-CwuwVp6r.js → mcp-command-DMHz7PmL.js} +9 -9
- package/dist/ui/assets/{memory-curation-seam-BMeMHKkg.js → memory-curation-seam-epGReJuG.js} +1 -1
- package/dist/ui/assets/{memory-health-Bvv6LYKB.js → memory-health-BYR_Y-0X.js} +1 -1
- package/dist/ui/assets/{memory-write-execute-CPixKZV3.js → memory-write-execute-DT_htd19.js} +1 -1
- package/dist/ui/assets/{merge-folded-cost-into-frozen-hv0-jK2p.js → merge-folded-cost-into-frozen-DimTAP8-.js} +1 -1
- package/dist/ui/assets/{new-session-DspiDGrn.js → new-session-D3NIubwl.js} +2 -2
- package/dist/ui/assets/oauth-bootstrap-dt8ZYlvi.js +2 -0
- package/dist/ui/assets/{onboarding-orchestrator-DkOtMT6l.js → onboarding-orchestrator-DB4uV5QM.js} +1 -1
- package/dist/ui/assets/{openai-codex-DPx8bB-I.js → openai-codex-CR-4SKAR.js} +1 -1
- package/dist/ui/assets/{openai-codex-DqI-LV1p.js → openai-codex-Cl-z58Kf.js} +1 -1
- package/dist/ui/assets/{openrouter-Bm5NKbSA.js → openrouter-BNdMnkix.js} +1 -1
- package/dist/ui/assets/{openrouter-CX8Bzh4-.js → openrouter-D79_Vd4c.js} +1 -1
- package/dist/ui/assets/{openrouter-free-Dio8R8YY.js → openrouter-free-C1-Bj_Xx.js} +1 -1
- package/dist/ui/assets/{openrouter-free-BtMhJjpj.js → openrouter-free-CQa1CoO4.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-CYyzK9z-.js → openrouter-oauth-DOazjMTa.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DTvqvfHg.js → openrouter-oauth-D_I7eEtl.js} +1 -1
- package/dist/ui/assets/panel-rpc-handlers-BzU1tjGq.js +2 -0
- package/dist/ui/assets/{panelize-shell-BF3KcP4C.js → panelize-shell-B0pTufSe.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-2UPU8l9Z.js → pi-edit-execution-CvC4g6ge.js} +1 -1
- package/dist/ui/assets/{provider-BVH2DJ2j.js → provider-BVtwgFuj.js} +1 -1
- package/dist/ui/assets/{provider-C8H2Tzfg.js → provider-D5HnoEAQ.js} +1 -1
- package/dist/ui/assets/{provider-settings-SY82ESoD.js → provider-settings-Eedtvqyh.js} +1 -1
- package/dist/ui/assets/provider-store-access-Cb_QGFws.js +1 -0
- package/dist/ui/assets/provider-store-access-DpnMfiJL.js +1 -0
- package/dist/ui/assets/providers-CR6zPkBA.js +2 -0
- package/dist/ui/assets/{providers-CefzTaF8.js → providers-CxXqdsb8.js} +1 -1
- package/dist/ui/assets/{quick-llm-DiEAuzzI.js → quick-llm-OcogX5yH.js} +1 -1
- package/dist/ui/assets/{realm-inprocess-Cc3228-9.js → realm-inprocess-D4P5wFOE.js} +2 -2
- package/dist/ui/assets/{realm-unhandled-rejections-BcZm-Y2j.js → realm-unhandled-rejections-BcTVMNp-.js} +1 -1
- package/dist/ui/assets/{realm-unhandled-rejections-TLpLRRgO.js → realm-unhandled-rejections-CKtowxzG.js} +1 -1
- package/dist/ui/assets/{recovery-screen-Cl89ahLT.js → recovery-screen-BGirKYu_.js} +1 -1
- package/dist/ui/assets/{remote-terminal-view-D82qMvNy.js → remote-terminal-view-qc6RzQpT.js} +2 -2
- package/dist/ui/assets/{restore-yq1C_osw.js → restore-BRsw6f-s.js} +1 -1
- package/dist/ui/assets/{run-DZrK_oOt.js → run-BpasEHV5.js} +2 -2
- package/dist/ui/assets/{run-Cu8PtYCw.js → run-CjVzDP7D.js} +2 -2
- package/dist/ui/assets/{run-tc2VFBej.js → run-Co30Tf9M.js} +1 -1
- package/dist/ui/assets/{run-BPeIvqOM.js → run-D4C2w6Ix.js} +1 -1
- package/dist/ui/assets/{session-command-memory-CDOmbg5g.js → session-command-memory-XnFNRIFA.js} +2 -2
- package/dist/ui/assets/{session-jsonl-D_UZgGp5.js → session-jsonl-CrcMW8fx.js} +1 -1
- package/dist/ui/assets/{session-jsonl-C4593KNn.js → session-jsonl-DO6bKeXA.js} +1 -1
- package/dist/ui/assets/{session-search-index-CUPFfLvv.js → session-search-index-CeQkxdD7.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-cYu5aVbG.js → setup-feature-flags-remote-BSbLoDdK.js} +1 -1
- package/dist/ui/assets/{setup-model-catalog-CR19K3-A.js → setup-model-catalog-DKaFLDA2.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-Bvrf2Hhh.js → silent-renew-backoff-JpXc1wkl.js} +1 -1
- package/dist/ui/assets/slicc-version-BfDpFkW3.js +1 -0
- package/dist/ui/assets/{soundscape-DxIHlkzy.js → soundscape-CD-xcN6Z.js} +1 -1
- package/dist/ui/assets/{speak-DkUF9yAq.js → speak-DgoChm2i.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-UTFA1mfr.js → sprinkle-manager-CDJc_08W.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-Cr1UxyZz.js → sprinkle-renderer-Dur1ZNnK.js} +1 -1
- package/dist/ui/assets/{sudo-SwaFp2JP.js → sudo-DO4cHGWe.js} +1 -1
- package/dist/ui/assets/{supervisor-DvFfdQZG.js → supervisor-DsxjOzXp.js} +1 -1
- package/dist/ui/assets/{sync-dialog-89X_eADs.js → sync-dialog-Ca6pboEO.js} +1 -1
- package/dist/ui/assets/{transformers-env-C6jpYwFE.js → transformers-env-lnsOWAhF.js} +1 -1
- package/dist/ui/assets/{tray-leader-2nVEUays.js → tray-leader-IzNrTl6C.js} +1 -1
- package/dist/ui/assets/{tray-leave-runtime-Bn1GC9Cf.js → tray-leave-runtime-C1DwCeQz.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-DmR9wMCP.js → tray-sidecar-DyqniZfp.js} +1 -1
- package/dist/ui/assets/{turn-journal-EgGBqAjY.js → turn-journal-CVQtwHPx.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-CHMH6iyk.js → upgrade-detection-GSR1EuFa.js} +1 -1
- package/dist/ui/assets/utf16-clip-Dcxt-q1C.js +1 -0
- package/dist/ui/assets/{voice-reply-BSouYhfc.js → voice-reply-BaAuLq60.js} +1 -1
- package/dist/ui/assets/wc-attach-sJ3NMqHQ.js +13 -0
- package/dist/ui/assets/{wc-browser-_YDya6R4.js → wc-browser-u5uzxk-d.js} +1 -1
- package/dist/ui/assets/{wc-computers-DsTSGd08.js → wc-computers-BX1yCXPi.js} +1 -1
- package/dist/ui/assets/{wc-detached-Cnh8X5Wm.js → wc-detached-U-XIb2f6.js} +1 -1
- package/dist/ui/assets/wc-extension-BgC75srq.js +2 -0
- package/dist/ui/assets/wc-follower-C6KuLED-.js +17 -0
- package/dist/ui/assets/{wc-follower-oauth-D8E_ti39.js → wc-follower-oauth-DsNONUfK.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-BCuLQnrY.js → wc-gelatiere-C1LMmmP-.js} +1 -1
- package/dist/ui/assets/wc-live-BvTlZWIq.js +248 -0
- package/dist/ui/assets/wc-nav-DAZqGqhf.js +2 -0
- package/dist/ui/assets/{wc-onboarding-myCW-Onf.js → wc-onboarding-Cf7ATuAZ.js} +2 -2
- package/dist/ui/assets/{wc-permissions-Baf4WNdK.js → wc-permissions-BfNzwBXu.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-C0mKH-Yt.js → wc-placeholder-73ZpUgXT.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-DLrIa256.js → wc-secret-request-BztOdnag.js} +1 -1
- package/dist/ui/assets/{wc-settings-C14VLbGh.js → wc-settings-ClXzlz1S.js} +3 -3
- package/dist/ui/assets/{wc-shell-BTfKKBgo.js → wc-shell-BBeNiS8R.js} +4 -4
- package/dist/ui/assets/{wc-shortcut-config-BvDHKCy0.js → wc-shortcut-config-DNDBw_BA.js} +1 -1
- package/dist/ui/assets/wc-sprinkles-ClXMSwxA.js +2 -0
- package/dist/ui/assets/{wc-transcript-export-CyRiKnwi.js → wc-transcript-export-APmcHVyY.js} +2 -2
- package/dist/ui/assets/{wc-tray-jeohKKcJ.js → wc-tray-B9Wksuuv.js} +4 -4
- package/dist/ui/assets/welcome-detection-CjuV_cig.js +1 -0
- package/dist/ui/assets/whisper-session-Bd6DyWgL.js +2 -0
- package/dist/ui/assets/{xai-grok-CpBrt9ak.js → xai-grok-CKLvBVjv.js} +1 -1
- package/dist/ui/assets/{xai-grok-BFykbO4p.js → xai-grok-ummZtHNw.js} +1 -1
- package/dist/ui/index.html +5 -4
- package/dist/ui/packages/webapp/index.html +5 -4
- package/package.json +1 -1
- package/dist/ui/assets/context-compaction-B8b3xc1C.js +0 -58
- package/dist/ui/assets/core-Cx9N3lmn.js +0 -62
- package/dist/ui/assets/live-session-curation-C8WI_jMh.js +0 -186
- package/dist/ui/assets/main-Cxb1a5Uz.js +0 -22
- package/dist/ui/assets/oauth-bootstrap-Dya1IvMk.js +0 -2
- package/dist/ui/assets/panel-rpc-handlers-DfSkY8OF.js +0 -2
- package/dist/ui/assets/provider-store-access-Cd8AQEiQ.js +0 -1
- package/dist/ui/assets/provider-store-access-DbDmDCT_.js +0 -1
- package/dist/ui/assets/providers-DollmArp.js +0 -2
- package/dist/ui/assets/slicc-version-BxghrDTL.js +0 -1
- package/dist/ui/assets/wc-attach-4HlzE8yC.js +0 -13
- package/dist/ui/assets/wc-extension-CTg_a4Zu.js +0 -2
- package/dist/ui/assets/wc-follower-CpxmTt8d.js +0 -17
- package/dist/ui/assets/wc-live-1-EV8_qk.js +0 -248
- package/dist/ui/assets/wc-nav-BJ5I51NK.js +0 -2
- package/dist/ui/assets/wc-sprinkles-ZL0xE_Cs.js +0 -2
- package/dist/ui/assets/welcome-detection-CuDKZAa8.js +0 -1
- package/dist/ui/assets/whisper-session-Ch8cDNVc.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./wc-onboarding-Cf7ATuAZ.js";export{e as hasOnboardingFinalLickInHistory};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/speak-DgoChm2i.js","assets/preload-helper-Czpn1I53.js","assets/logger-DDBAeTLF.js","assets/runtime-env-Dlaokqg1.js","assets/speech-assets-bridge-CFYafE89.js","assets/transformers-env-lnsOWAhF.js","assets/wc-shell-BBeNiS8R.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/mime-types-D0xZwlMO.js","assets/base64-ELzoYfwP.js","assets/bridge-protocol-C52CnDIj.js","assets/account-store-BZBj_ntG.js","assets/core-BFRZk2b-.js","assets/compat-BAGLwgqY.js","assets/models-Xc0Gclrk.js","assets/diagnostics-Cag7MsZI.js","assets/env-api-keys-BXRkymgV.js","assets/provider-env-CTOcDKrQ.js","assets/__vite-browser-external-5eBdwsFd.js","assets/openrouter.models-DHpsqCCC.js","assets/libesm-BypnjKEL.js","assets/utf16-clip-CGL7omVm.js","assets/feature-flags-DvsApnS-.js","assets/proxied-fetch-4VBgrEIu.js","assets/proxy-error-BSFYY7jj.js","assets/api-endpoint-DuEQRZ4g.js","assets/secret-topology-hMRoGGjt.js","assets/float-topology-C_iRKPQK.js","assets/secrets-bridge-client-D734Xx8G.js","assets/port-bridge-client-B-gpiOVR.js","assets/panel-rpc-accessor-B4BfPLSo.js","assets/image-markers-q8JQTtid.js","assets/tool-ui-eSQ1g2I1.js","assets/providers-CR6zPkBA.js","assets/stored-accounts-ChNHYF68.js","assets/bedrock-camp-compat-B1oHsbyo.js","assets/bedrock-camp-extra-models-BYrxX19D.js","assets/claude-model-version-DZmbk9E2.js","assets/same-file-identity-OexpsaSD.js","assets/telemetry-B0sKnLBU.js","assets/types-D8gIX-W-.js","assets/icons-BJTFywJo.js","assets/wc-shell-WkeczD9x.css","assets/shared-DSEuryGJ.js","assets/transformers.web-BBJR2ai3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-Czpn1I53.js";import{t}from"./logger-DDBAeTLF.js";import{a as n,n as r,o as i,r as a,t as o}from"./transformers-env-lnsOWAhF.js";var s=t(`speech:whisper`),c=null,l=`idle`,u=null,d=new Set;function f(){return l}function p(){return u}function m(e){return e&&d.add(e),c||=(l=`loading`,g().then(e=>(l=`ready`,h(),e),e=>{throw l=`failed`,c=null,s.error(`whisper load failed`,e),e})),c}function h(){e(async()=>{let{kokoroWarmup:e}=await import(`./speak-DgoChm2i.js`);return{kokoroWarmup:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43])).then(({kokoroWarmup:e})=>e()).catch(e=>s.warn(`kokoro warmup (chained after whisper) failed`,e))}async function g(){let{pipeline:t,env:c}=await e(async()=>{let{pipeline:e,env:t}=await import(`./transformers.web-BBJR2ai3.js`);return{pipeline:e,env:t}},__vite__mapDeps([44,7,1]));r(c),await o(n),await a();let l=i(),f=e=>{if(e?.file){if(e.status===`progress`)l.update(e.file,e.loaded??0,e.total??0);else if(e.status===`done`)l.complete(e.file);else return;u=l.snapshot();for(let e of d)e(u)}},p=async e=>await t(`automatic-speech-recognition`,n,{device:e,dtype:e===`webgpu`?`fp32`:`q8`,progress_callback:f}),m=typeof navigator<`u`&&`gpu`in navigator,h;if(m)try{h=await p(`webgpu`)}catch(e){s.warn(`whisper webgpu init failed; retrying on wasm`,e),h=await p(`wasm`)}else h=await p(`wasm`);return s.info(`whisper ready`,{model:n,device:m?`webgpu`:`wasm`}),{async transcribe(e,t){let n=performance.now(),r=await h(e,{chunk_length_s:30,task:`transcribe`,...t?.language?{language:t.language}:{}}),i=Array.isArray(r)?r.map(e=>e.text??``).join(` `):r.text??``;return s.info(`whisper transcribe`,{elapsedMs:Math.round(performance.now()-n),audioSeconds:Math.round(e.length/160)/100,numThreads:c.backends?.onnx?.wasm?.numThreads,device:m?`webgpu`:`wasm`}),i.trim()}}}var _=16e3;async function v(e){if(typeof AudioContext>`u`||typeof OfflineAudioContext>`u`)throw Error(`audio decoding requires a window/page realm (AudioContext unavailable)`);let t=new AudioContext,n;try{n=await t.decodeAudioData(e.slice(0))}finally{await t.close().catch(()=>{})}let r=Math.max(1,Math.ceil(n.duration*_)),i=new OfflineAudioContext(1,r,_),a=i.createBufferSource();return a.buffer=n,a.connect(i.destination),a.start(),(await i.startRendering()).getChannelData(0).slice(0)}var y=t(`speech:whisper-session`),b=2e3,x=500,S=5e3,C=3e4,w=(e,t,n)=>new Promise((r,i)=>{let a=setTimeout(()=>i(Error(`${n} timed out after ${t}ms`)),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e)})});function T(e){return e?.split(`-`)[0]?.toLowerCase()||void 0}async function E(e,t){let n;if(t.stream)n=t.stream;else{if(!navigator.mediaDevices?.getUserMedia)throw Error(`microphone capture unavailable in this realm`);n=await navigator.mediaDevices.getUserMedia({audio:t.deviceId&&t.deviceId!=="default"?{deviceId:{exact:t.deviceId}}:!0})}let r=new MediaRecorder(n),i=[],a=T(t.lang),o=!1,s=!1;r.ondataavailable=e=>{e.data.size>0&&i.push(e.data)};let c=async()=>{if(i.length===0)return``;let t=await v(await new Blob(i,{type:r.mimeType||`audio/webm`}).arrayBuffer());return e.transcribe(t,{language:a})},l=Promise.resolve(``),u=()=>{let e=l.catch(()=>``).then(()=>c());return l=e.catch(()=>``),e},d=setInterval(()=>{o||s||i.length===0||(o=!0,u().then(e=>{!s&&e&&t.onPartial?.(e)}).catch(e=>{y.warn(`partial transcription failed`,e)}).finally(()=>{o=!1}))},b),f=()=>{if(clearInterval(d),r.state!==`inactive`)try{r.stop()}catch{}for(let e of n.getTracks())e.stop()},p=()=>new Promise(e=>{if(r.state===`inactive`){e();return}r.onstop=()=>e();try{r.stop()}catch{e()}});return r.start(x),{async stop(){if(s)return``;s=!0,clearInterval(d);try{await w(p(),S,`recorder flush`);for(let e of n.getTracks())e.stop();return await w(u(),C,`transcription`)}catch(e){for(let e of n.getTracks())e.stop();let r=e instanceof Error?e.message:String(e);return t.onError?.(`transcription failed: ${r}`),``}},cancel(){s||(s=!0,f())}}}export{p as a,m as i,T as n,f as o,v as r,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./core-
|
|
1
|
+
import{a as e}from"./core-BFRZk2b-.js";import{a as t}from"./diagnostics-Cag7MsZI.js";import{a as n}from"./compat-BAGLwgqY.js";import{c as r,i,r as a,s as o}from"./legacy-api-aliases-BjgG1CsY.js";import{W as s,u as c}from"./account-store-BZBj_ntG.js";import"./main-CvCAlghs.js";import{n as l}from"./pi-transcript-context-miZCMig3.js";import{n as u,r as d}from"./bridge-token-required-DMk2va9k.js";import{n as f,r as p,t as m}from"./pkce-hGf_TEnP.js";import{XaiErrorCode as h,XaiOAuthError as g}from"./xai-grok-errors-bnlIBeu-.js";var _=`https://cli-chat-proxy.grok.com/v1/billing?format=credits`,v=8e3,y=65536,b=1e3;function x(e){return typeof e==`object`&&!!e}function S(e){if(!x(e))return null;let t=x(e.config)?e.config:e,n=t.creditUsagePercent;if(typeof n!=`number`||!Number.isFinite(n))return null;let r=Math.min(b,Math.max(0,n)),i=x(t.currentPeriod)?t.currentPeriod:{},a=i.type,o=typeof a==`string`?a.replace(`USAGE_PERIOD_TYPE_`,``).toLowerCase():``,s=i.end??t.billingPeriodEnd,c=typeof s==`string`&&Number.isFinite(Date.parse(s))?s:void 0;return{percent:r,status:`ok`,window:o&&o!==`unspecified`?o:`billing`,...c?{resetsAt:c}:{}}}async function C(e,t,n={}){let r=new AbortController,i=setTimeout(()=>r.abort(),n.timeoutMs??v);try{let n=await t(_,{headers:{Authorization:`Bearer ${e}`},signal:r.signal}),{status:i}=n;if(i===404||i===501)return null;if(!n.ok)throw Error(`xAI Grok usage: ${i===401||i===403?`re-login required`:`failed`} (${i})`);let a=await n.text();if(a.length>y)return null;try{return S(JSON.parse(a))}catch{return null}}finally{clearTimeout(i)}}var w=`xai-grok`,T=`https://auth.x.ai`,E=`${T}/oauth2/authorize`,D=`${T}/oauth2/token`,O=`b1a00492-073a-47ea-816f-4c329264a828`,k=`openid profile email offline_access grok-cli:access api:access`,A=`http://127.0.0.1:56121/callback`,j=`http://127.0.0.1:56121/*`,M=`https://api.x.ai/v1`,N=`grok-4.7`,P=`${w}-openai`;function F(e){if(e.some(e=>e.id===N))return e;let t=e.find(e=>e.id===`grok-4.6`)??e.find(e=>e.api===`openai-responses`)??e[0];return t?[{...t,id:N,name:`Grok 4.7`,api:`openai-responses`,reasoning:!0,input:[`text`,`image`],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:`low`,medium:`medium`,high:`high`,xhigh:`xhigh`,max:null}},...e]:e}function I(){return F(e(`xai`))}function L(e){return{id:e.id,name:e.name,api:`openai`,reasoning:e.reasoning,input:e.input,context_window:e.contextWindow,max_tokens:e.maxTokens,compat:e.compat,thinkingLevelMap:e.thinkingLevelMap,cost:e.cost}}function R(e){let t=I(),n=t.find(t=>t.id===e.id);if(!n&&(console.warn(`xAI model "${e.id}" is no longer in the pi-ai catalog; falling back to default "${N}"`),n=t.find(e=>e.id===N),!n))throw Error(`xAI default model "${N}" is not registered by pi-ai`);if(n.api!==`openai-responses`&&n.api!==`openai-completions`)throw Error(`Unsupported pi-ai API "${n.api}" for xAI model "${e.id}"`);return{...e,...n,baseUrl:M}}async function z(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,code:e,redirect_uri:A,client_id:O,code_verifier:t}),r=await fetch(D,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw new g(`xAI token exchange failed: ${r.status} ${await r.text()}`,h.TOKEN_EXCHANGE_FAILED);let i=await r.json();if(!i.access_token)throw new g(`xAI token exchange did not return access_token.`,h.TOKEN_EXCHANGE_INVALID);return i}async function B(e){if(u())return null;try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:O}),n=await fetch(D,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});if(!n.ok){let e=await n.text();return d(n.status,e)||console.error(`[xai-grok] refresh failed:`,n.status,e),null}return await n.json()}catch(e){return console.error(`[xai-grok] refresh error:`,e instanceof Error?e.message:String(e)),null}}function V(){return c().find(e=>e.providerId===w)}async function H(){let e=V();if(!e?.accessToken)throw new g("Not signed in to xAI Grok — run /login or `oauth-token xai-grok`",h.AUTH_MISSING,!0);let t=e.tokenExpiresAt??0;if(t&&Date.now()+6e4<t)return e.accessToken;if(e.refreshToken){let t=await B(e.refreshToken);if(t?.access_token)return await s({providerId:w,accessToken:t.access_token,refreshToken:t.refresh_token??e.refreshToken,tokenExpiresAt:Date.now()+(t.expires_in??21600)*1e3,scopes:t.scope??e.scopes}),t.access_token}return e.accessToken}async function U(){if(!V()?.accessToken)throw Error(`xAI Grok budget: not signed in`);return C(await H(),fetch)}function W(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:P,provider:w,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function G(e,t){return t?{...e??{},"x-grok-conv-id":t}:e}function K(e){console.error(`[xai-grok] Stream error:`,e instanceof Error?e.message:String(e))}async function q(e,t,n,r){try{let o=await H(),s=r.sessionId,c=R(t),u={...r,apiKey:o,headers:G(r.headers,s)},d=c.api===`openai-responses`?i(c,l(n),u):a(c,l(n),u);for await(let t of d)e.push(t);e.end()}catch(n){K(n),e.push(W(t,n)),e.end()}}async function J(e,t,n,i){try{let a=await H(),s=i?.sessionId,c=R(t),u={...i,apiKey:a,headers:G(i?.headers,s)},d=c.api===`openai-responses`?r(c,l(n),u):o(c,l(n),u);for await(let t of d)e.push(t);e.end()}catch(n){K(n),e.push(W(t,n)),e.end()}}var Y=(e,n,r={})=>{let i=t();return q(i,e,n,r).catch(K),i},X=(e,n,r)=>{let i=t();return J(i,e,n,r).catch(K),i},Z={id:w,name:`xAI Grok (SuperGrok OAuth)`,description:`Grok via xAI OAuth — uses your SuperGrok subscription, no API key needed. Default model is Grok 4.7.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:N,oauthTokenDomains:[`api.x.ai`,`*.x.ai`,`auth.x.ai`,`accounts.x.ai`,`cli-chat-proxy.grok.com`],getModelIds:()=>I().map(L),getBudgetUsage:U,onOAuthLoginIntercepted:async(e,t,n)=>{let r=f(),i=await m(r),a=p(),o=p(),c=new URL(E);c.searchParams.set(`response_type`,`code`),c.searchParams.set(`client_id`,O),c.searchParams.set(`redirect_uri`,A),c.searchParams.set(`scope`,n?.scopes??k),c.searchParams.set(`code_challenge`,i),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,a),c.searchParams.set(`nonce`,o),c.searchParams.set(`plan`,`generic`),c.searchParams.set(`referrer`,`slicc`);let l=await e({authorizeUrl:c.toString(),redirectUriPattern:j,onCapture:`close`});if(!l)throw new g(`xAI OAuth login was cancelled or timed out`,h.CALLBACK_TIMEOUT);let u=new URL(l),d=u.searchParams.get(`code`),_=u.searchParams.get(`state`);if(!d)throw new g(`xAI OAuth redirect did not include a code`,h.CODE_MISSING);if(_!==a)throw new g(`xAI OAuth state mismatch — possible CSRF, aborting`,h.STATE_MISMATCH);let v=await z(d,r);await s({providerId:w,accessToken:v.access_token,refreshToken:v.refresh_token,tokenExpiresAt:Date.now()+(v.expires_in??21600)*1e3,baseUrl:M,scopes:v.scope}),t()},onOAuthLogout:async()=>{await s({providerId:w,accessToken:``})},onSilentRenew:async()=>{let e=V();if(!e?.refreshToken)return null;let t=await B(e.refreshToken);return t?.access_token?(await s({providerId:w,accessToken:t.access_token,refreshToken:t.refresh_token??e.refreshToken,tokenExpiresAt:Date.now()+(t.expires_in??21600)*1e3,scopes:t.scope??e.scopes}),t.access_token):null}};function Q(){n({api:P,stream:Y,streamSimple:X})}export{h as XaiErrorCode,g as XaiOAuthError,Z as config,Q as register};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,r as t}from"./account-store-
|
|
1
|
+
import{_ as e,r as t}from"./account-store-DkttH-BP.js";import{a as n}from"./diagnostics-Cag7MsZI.js";import{a as r}from"./compat-nGhSz-U1.js";import{a as i}from"./core-EGZ5TU35.js";import{c as a,i as o,r as s,s as c}from"./legacy-api-aliases--xyLjPgC.js";import{n as l}from"./pi-transcript-context-4pjVPiVC.js";import"./provider-settings-Eedtvqyh.js";import{n as u,r as d}from"./bridge-token-required-BYgoMwr7.js";import{n as f,r as p,t as m}from"./pkce-hGf_TEnP.js";import{XaiErrorCode as h,XaiOAuthError as g}from"./xai-grok-errors-ByEMMSoz.js";function _(e){return typeof e==`object`&&!!e}function v(e){if(!_(e))return null;let t=_(e.config)?e.config:e,n=t.creditUsagePercent;if(typeof n!=`number`||!Number.isFinite(n))return null;let r=Math.min(1e3,Math.max(0,n)),i=_(t.currentPeriod)?t.currentPeriod:{},a=i.type,o=typeof a==`string`?a.replace(`USAGE_PERIOD_TYPE_`,``).toLowerCase():``,s=i.end??t.billingPeriodEnd,c=typeof s==`string`&&Number.isFinite(Date.parse(s))?s:void 0;return{percent:r,status:`ok`,window:o&&o!==`unspecified`?o:`billing`,...c?{resetsAt:c}:{}}}async function y(e,t,n={}){let r=new AbortController,i=setTimeout(()=>r.abort(),n.timeoutMs??8e3);try{let n=await t(`https://cli-chat-proxy.grok.com/v1/billing?format=credits`,{headers:{Authorization:`Bearer ${e}`},signal:r.signal}),{status:i}=n;if(i===404||i===501)return null;if(!n.ok)throw Error(`xAI Grok usage: ${i===401||i===403?`re-login required`:`failed`} (${i})`);let a=await n.text();if(a.length>65536)return null;try{return v(JSON.parse(a))}catch{return null}}finally{clearTimeout(i)}}const b=`xai-grok`,x=`https://auth.x.ai`,S=`${x}/oauth2/authorize`,C=`${x}/oauth2/token`,w=`b1a00492-073a-47ea-816f-4c329264a828`,T=`http://127.0.0.1:56121/callback`,E=`https://api.x.ai/v1`,D=`grok-4.7`,O=`${b}-openai`;function k(e){if(e.some(e=>e.id===D))return e;let t=e.find(e=>e.id===`grok-4.6`)??e.find(e=>e.api===`openai-responses`)??e[0];return t?[{...t,id:D,name:`Grok 4.7`,api:`openai-responses`,reasoning:!0,input:[`text`,`image`],cost:{input:2,output:6,cacheRead:.5,cacheWrite:0},contextWindow:5e5,maxTokens:5e5,thinkingLevelMap:{off:null,minimal:null,low:`low`,medium:`medium`,high:`high`,xhigh:`xhigh`,max:null}},...e]:e}function A(){return k(i(`xai`))}function j(e){return{id:e.id,name:e.name,api:`openai`,reasoning:e.reasoning,input:e.input,context_window:e.contextWindow,max_tokens:e.maxTokens,compat:e.compat,thinkingLevelMap:e.thinkingLevelMap,cost:e.cost}}function M(e){let t=A(),n=t.find(t=>t.id===e.id);if(!n&&(console.warn(`xAI model "${e.id}" is no longer in the pi-ai catalog; falling back to default "${D}"`),n=t.find(e=>e.id===D),!n))throw Error(`xAI default model "${D}" is not registered by pi-ai`);if(n.api!==`openai-responses`&&n.api!==`openai-completions`)throw Error(`Unsupported pi-ai API "${n.api}" for xAI model "${e.id}"`);return{...e,...n,baseUrl:E}}async function N(e,t){let n=new URLSearchParams({grant_type:`authorization_code`,code:e,redirect_uri:T,client_id:w,code_verifier:t}),r=await fetch(C,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:n});if(!r.ok)throw new g(`xAI token exchange failed: ${r.status} ${await r.text()}`,h.TOKEN_EXCHANGE_FAILED);let i=await r.json();if(!i.access_token)throw new g(`xAI token exchange did not return access_token.`,h.TOKEN_EXCHANGE_INVALID);return i}async function P(e){if(u())return null;try{let t=new URLSearchParams({grant_type:`refresh_token`,refresh_token:e,client_id:w}),n=await fetch(C,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:t});if(!n.ok){let e=await n.text();return d(n.status,e)||console.error(`[xai-grok] refresh failed:`,n.status,e),null}return await n.json()}catch(e){return console.error(`[xai-grok] refresh error:`,e instanceof Error?e.message:String(e)),null}}function F(){return t().find(e=>e.providerId===b)}async function I(){let t=F();if(!t?.accessToken)throw new g("Not signed in to xAI Grok — run /login or `oauth-token xai-grok`",h.AUTH_MISSING,!0);let n=t.tokenExpiresAt??0;if(n&&Date.now()+6e4<n)return t.accessToken;if(t.refreshToken){let n=await P(t.refreshToken);if(n?.access_token)return await e({providerId:b,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token}return t.accessToken}async function L(){if(!F()?.accessToken)throw Error(`xAI Grok budget: not signed in`);return y(await I(),fetch)}function R(e,t){return{type:`error`,reason:`error`,error:{role:`assistant`,content:[],api:O,provider:b,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:`error`,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()}}}function z(e,t){return t?{...e??{},"x-grok-conv-id":t}:e}function B(e){console.error(`[xai-grok] Stream error:`,e instanceof Error?e.message:String(e))}async function V(e,t,n,r){try{let i=await I(),a=r.sessionId,c=M(t),u={...r,apiKey:i,headers:z(r.headers,a)},d=c.api===`openai-responses`?o(c,l(n),u):s(c,l(n),u);for await(let t of d)e.push(t);e.end()}catch(n){B(n),e.push(R(t,n)),e.end()}}async function H(e,t,n,r){try{let i=await I(),o=r?.sessionId,s=M(t),u={...r,apiKey:i,headers:z(r?.headers,o)},d=s.api===`openai-responses`?a(s,l(n),u):c(s,l(n),u);for await(let t of d)e.push(t);e.end()}catch(n){B(n),e.push(R(t,n)),e.end()}}const U=(e,t,r={})=>{let i=n();return V(i,e,t,r).catch(B),i},W=(e,t,r)=>{let i=n();return H(i,e,t,r).catch(B),i},G={id:b,name:`xAI Grok (SuperGrok OAuth)`,description:`Grok via xAI OAuth — uses your SuperGrok subscription, no API key needed. Default model is Grok 4.7.`,requiresApiKey:!1,requiresBaseUrl:!1,isOAuth:!0,defaultModelId:D,oauthTokenDomains:[`api.x.ai`,`*.x.ai`,`auth.x.ai`,`accounts.x.ai`,`cli-chat-proxy.grok.com`],getModelIds:()=>A().map(j),getBudgetUsage:L,onOAuthLoginIntercepted:async(t,n,r)=>{let i=f(),a=await m(i),o=p(),s=p(),c=new URL(S);c.searchParams.set(`response_type`,`code`),c.searchParams.set(`client_id`,w),c.searchParams.set(`redirect_uri`,T),c.searchParams.set(`scope`,r?.scopes??`openid profile email offline_access grok-cli:access api:access`),c.searchParams.set(`code_challenge`,a),c.searchParams.set(`code_challenge_method`,`S256`),c.searchParams.set(`state`,o),c.searchParams.set(`nonce`,s),c.searchParams.set(`plan`,`generic`),c.searchParams.set(`referrer`,`slicc`);let l=await t({authorizeUrl:c.toString(),redirectUriPattern:`http://127.0.0.1:56121/*`,onCapture:`close`});if(!l)throw new g(`xAI OAuth login was cancelled or timed out`,h.CALLBACK_TIMEOUT);let u=new URL(l),d=u.searchParams.get(`code`),_=u.searchParams.get(`state`);if(!d)throw new g(`xAI OAuth redirect did not include a code`,h.CODE_MISSING);if(_!==o)throw new g(`xAI OAuth state mismatch — possible CSRF, aborting`,h.STATE_MISMATCH);let v=await N(d,i);await e({providerId:b,accessToken:v.access_token,refreshToken:v.refresh_token,tokenExpiresAt:Date.now()+(v.expires_in??21600)*1e3,baseUrl:E,scopes:v.scope}),n()},onOAuthLogout:async()=>{await e({providerId:b,accessToken:``})},onSilentRenew:async()=>{let t=F();if(!t?.refreshToken)return null;let n=await P(t.refreshToken);return n?.access_token?(await e({providerId:b,accessToken:n.access_token,refreshToken:n.refresh_token??t.refreshToken,tokenExpiresAt:Date.now()+(n.expires_in??21600)*1e3,scopes:n.scope??t.scopes}),n.access_token):null}};function K(){r({api:O,stream:U,streamSimple:W})}export{h as XaiErrorCode,g as XaiOAuthError,G as config,K as register};
|
package/dist/ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-CvCAlghs.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/diagnostics-Cag7MsZI.js">
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/compat-BAGLwgqY.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/libesm-BypnjKEL.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/logger-DDBAeTLF.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/utf16-clip-CGL7omVm.js">
|
|
21
22
|
<link rel="modulepreload" crossorigin href="/assets/feature-flags-DvsApnS-.js">
|
|
22
23
|
<link rel="modulepreload" crossorigin href="/assets/base64-ELzoYfwP.js">
|
|
23
24
|
<link rel="modulepreload" crossorigin href="/assets/proxy-error-BSFYY7jj.js">
|
|
@@ -31,14 +32,14 @@
|
|
|
31
32
|
<link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-D734Xx8G.js">
|
|
32
33
|
<link rel="modulepreload" crossorigin href="/assets/image-markers-q8JQTtid.js">
|
|
33
34
|
<link rel="modulepreload" crossorigin href="/assets/tool-ui-eSQ1g2I1.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/core-
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/core-BFRZk2b-.js">
|
|
35
36
|
<link rel="modulepreload" crossorigin href="/assets/bridge-protocol-C52CnDIj.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/providers-
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/providers-CR6zPkBA.js">
|
|
37
38
|
<link rel="modulepreload" crossorigin href="/assets/stored-accounts-ChNHYF68.js">
|
|
38
39
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-compat-B1oHsbyo.js">
|
|
39
40
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-extra-models-BYrxX19D.js">
|
|
40
41
|
<link rel="modulepreload" crossorigin href="/assets/claude-model-version-DZmbk9E2.js">
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/assets/account-store-
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/account-store-BZBj_ntG.js">
|
|
42
43
|
<link rel="modulepreload" crossorigin href="/assets/telemetry-B0sKnLBU.js">
|
|
43
44
|
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BAjnN7Ar.js">
|
|
44
45
|
<link rel="modulepreload" crossorigin href="/assets/clipboard-eqmn97SP.js">
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>slicc</title>
|
|
7
7
|
<link rel="icon" type="image/png" href="/logos/sliccy-color-1scoops-32x32.png" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/main-
|
|
8
|
+
<script type="module" crossorigin src="/assets/main-CvCAlghs.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-P2Xu9kJm.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/diagnostics-Cag7MsZI.js">
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/compat-BAGLwgqY.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/libesm-BypnjKEL.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/logger-DDBAeTLF.js">
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/utf16-clip-CGL7omVm.js">
|
|
21
22
|
<link rel="modulepreload" crossorigin href="/assets/feature-flags-DvsApnS-.js">
|
|
22
23
|
<link rel="modulepreload" crossorigin href="/assets/base64-ELzoYfwP.js">
|
|
23
24
|
<link rel="modulepreload" crossorigin href="/assets/proxy-error-BSFYY7jj.js">
|
|
@@ -31,14 +32,14 @@
|
|
|
31
32
|
<link rel="modulepreload" crossorigin href="/assets/secrets-bridge-client-D734Xx8G.js">
|
|
32
33
|
<link rel="modulepreload" crossorigin href="/assets/image-markers-q8JQTtid.js">
|
|
33
34
|
<link rel="modulepreload" crossorigin href="/assets/tool-ui-eSQ1g2I1.js">
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/core-
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/core-BFRZk2b-.js">
|
|
35
36
|
<link rel="modulepreload" crossorigin href="/assets/bridge-protocol-C52CnDIj.js">
|
|
36
|
-
<link rel="modulepreload" crossorigin href="/assets/providers-
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/providers-CR6zPkBA.js">
|
|
37
38
|
<link rel="modulepreload" crossorigin href="/assets/stored-accounts-ChNHYF68.js">
|
|
38
39
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-compat-B1oHsbyo.js">
|
|
39
40
|
<link rel="modulepreload" crossorigin href="/assets/bedrock-camp-extra-models-BYrxX19D.js">
|
|
40
41
|
<link rel="modulepreload" crossorigin href="/assets/claude-model-version-DZmbk9E2.js">
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/assets/account-store-
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/account-store-BZBj_ntG.js">
|
|
42
43
|
<link rel="modulepreload" crossorigin href="/assets/telemetry-B0sKnLBU.js">
|
|
43
44
|
<link rel="modulepreload" crossorigin href="/assets/tray-follower-status-BAjnN7Ar.js">
|
|
44
45
|
<link rel="modulepreload" crossorigin href="/assets/clipboard-eqmn97SP.js">
|
package/package.json
CHANGED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-LESFN7Hj.js";import{c as t}from"./models-CET5SEuw.js";import{t as n}from"./compat-nGhSz-U1.js";const r={enabled:!0,reserveTokens:16384,keepRecentTokens:2e4};function i(e,t,n){return n.enabled?e>t-n.reserveTokens:!1}function a(e){if(typeof e==`string`)return e.length;let t=0;for(let n of e)n.type===`text`&&n.text?t+=n.text.length:n.type===`image`&&(t+=4800);return t}function o(e){let t=0;switch(e.role){case`system`:{let n=e;if(t=a(n.content),n.sections)for(let e of Object.values(n.sections))e&&(t+=e.length);return n.toolsAdded&&(t+=JSON.stringify(n.toolsAdded).length),Math.ceil(t/4)}case`user`:return t=a(e.content),Math.ceil(t/4);case`assistant`:{let n=e;for(let e of n.content)e.type===`text`?t+=e.text.length:e.type===`thinking`?t+=e.thinking.length:e.type===`toolCall`&&(t+=e.name.length+JSON.stringify(e.arguments).length);return Math.ceil(t/4)}case`custom`:case`toolResult`:return t=a(e.content),Math.ceil(t/4);case`bashExecution`:return t=e.command.length+e.output.length,Math.ceil(t/4);case`branchSummary`:case`compactionSummary`:return t=e.summary.length,Math.ceil(t/4)}return 0}const s=e(`context-compaction`);function c(e,n){if(e===n)return n;let r=t(e);return r?[r,...n.filter(e=>e.role!==`system`)]:n}function l(e,t){return e.role===t}function u(e){let t=0;for(;t<e.length&&l(e[t],`toolResult`);){let n=e[t];s.warn(`Dropping orphaned toolResult (no preceding assistant message)`,{toolCallId:n.toolCallId}),t++}return t>0?e.slice(t):e}function d(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${p(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${p(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${p(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${p(e.content)}\n</${e.role}>`)}}return t.join(`
|
|
2
|
-
|
|
3
|
-
`)}const f=/\n*The full transcript of the conversation before this compaction is saved at \S+ — read it when the summary is not enough\.?/g;function p(e){if(typeof e==`string`)return e.replace(f,``);if(!Array.isArray(e))return``;let t=[];for(let n of e){let e=n;e.type===`text`&&e.text?t.push(e.text.replace(f,``)):e.type===`thinking`&&e.thinking?t.push(`[thinking] ${e.thinking}`):e.type===`toolCall`?t.push(`[tool-call ${e.name??`?`}] ${JSON.stringify(e.arguments??{})}`):e.type===`image`&&t.push(`[image]`)}return t.join(`
|
|
4
|
-
`)}function m(e){return`You are a context compaction assistant. You are shown the prefix of a conversation between a user and an AI coding assistant, and asked to produce either a structured summary, durable memory bullets, or a short title — depending on the user's instruction.
|
|
5
|
-
|
|
6
|
-
Do NOT continue the conversation. Do NOT answer questions inside the conversation. Output ONLY what the user asks for in the format specified.
|
|
7
|
-
|
|
8
|
-
<conversation>
|
|
9
|
-
${e}
|
|
10
|
-
</conversation>`}var h=class extends Error{failure;constructor(e,t){super(t),this.failure=e,this.name=`CompactionCallError`}};function g(e){if(e instanceof h)return e.failure;let t=typeof e==`object`&&e?e:void 0,n=t?.status??t?.statusCode??t?.code,r=typeof t?.message==`string`?t.message.toLowerCase():String(e).toLowerCase();return n===429||n===`429`||/rate[ -]?limit|too many requests|throttl/.test(r)?`rate-limit`:/quota|credit|budget|billing|allowance|resource exhausted/.test(r)?`quota-exhausted`:n===401||n===`401`||/unauthori[sz]ed|authentication|invalid api.?key|invalid x-api-key|session expired/.test(r)?`authentication`:typeof n==`number`&&n>=500||typeof n==`string`&&/^5\d\d$/.test(n)||/service unavailable|provider unavailable|overloaded|outage|timed? out|timeout|network|fetch failed|connection/.test(r)?`provider-unavailable`:`unknown`}async function _(e,t,r,i,a,o,s){let c=await n(e,{systemPrompt:r,messages:[{role:`user`,content:[{type:`text`,text:i}],timestamp:Date.now()}]},{maxTokens:a,apiKey:t,headers:o,signal:s});if(typeof c!=`object`||!c)throw new h(`invalid-response`,`Compaction call returned no response`);let l=c;if(typeof l.stopReason!=`string`||!Array.isArray(l.content))throw new h(`invalid-response`,`Compaction call returned an invalid response envelope`);if(l.stopReason===`error`){let e=typeof l.errorMessage==`string`?l.errorMessage:`Unknown provider error`;throw new h(g(Error(e)),`Compaction call failed: ${e}`)}let u=l.content.filter(e=>typeof e==`object`&&!!e&&e.type===`text`);if(u.some(e=>typeof e.text!=`string`))throw new h(`invalid-response`,`Compaction call returned an invalid text block`);let d=u.map(e=>e.text).join(`
|
|
11
|
-
`).trim();if(!d)throw new h(`empty-response`,`Compaction call returned no summary text`);return d}function v(e){if(typeof e==`string`)return e.length;if(!Array.isArray(e))return 0;let t=0;for(let n of e){let e=n;if(e.type===`text`&&e.text)t+=e.text.length;else if(e.type===`thinking`&&e.thinking)t+=e.thinking.length;else if(e.type===`toolCall`&&e.arguments!==void 0)try{t+=JSON.stringify(e.arguments).length}catch{}else e.type===`image`&&e.source?.data&&(t+=e.source.data.length)}return t}function y(e,t){let n=Math.max(1,Math.round(e/1024));return`[${t===`assistant`?`Assistant message elided`:`Tool result elided`}: ${n} KB, exceeds half the context window. Re-run with smaller arguments — e.g. open --view --size low.]`}function b(e){let t=e.role,n=e.content,r=v(n);if(t===`toolResult`)return{...e,content:[{type:`text`,text:y(r,t)}]};let i=(Array.isArray(n)?n.filter(e=>e.type===`toolCall`):[]).map(e=>{let t=0;if(e.arguments!==void 0)try{t=JSON.stringify(e.arguments).length}catch{}return{type:e.type,id:e.id,name:e.name,arguments:{elided:!0,originalBytes:t}}});return{...e,content:[{type:`text`,text:y(r,t)},...i]}}function x(e,t,n){let r=(t-n)/2,i=0,a=0;return{messages:e.map(e=>{if(w(e)<=r)return e;let t=e.role;if(t!==`toolResult`&&t!==`assistant`)return e;let n=e,o=v(n.content);return t===`toolResult`?(i++,a+=o,b(e)):(Array.isArray(n.content)?n.content:[]).filter(e=>e.type===`toolCall`).length===0?e:(i++,a+=o,b(e))}),elidedCount:i,elidedBytes:a}}function S(e,t,n){let r=0,i=0,a=x(e.map(e=>{let t=P(e);return t!==e&&(r++,i+=v(e.content)-v(t.content)),t}),t,n);return{messages:a.messages,elidedCount:r+a.elidedCount,elidedBytes:i+a.elidedBytes}}function C(e){if(!l(e,`assistant`))return 0;let t=e.content;if(!Array.isArray(t))return 0;let n=0;for(let e of t){let t=e;t.type===`thinking`&&typeof t.thinkingSignature==`string`&&(n+=t.thinkingSignature.length)}return n}function w(e){return o(e)+Math.ceil(C(e)/4)}function T(e){let t=0;for(let n of e)t+=w(n);return t}function E(e){for(let t=e.length-1;t>=0;t--){if(!l(e[t],`assistant`))continue;let n=e[t];if(n.stopReason===`aborted`||n.stopReason===`error`)continue;let r=n.usage;if(r&&D(r)>0)return t}return-1}function D(e){return e.totalTokens||e.input+e.output+e.cacheRead+e.cacheWrite}function O(e){let t=T(e),n=E(e);if(n===-1)return t;let r=D(e[n].usage);for(let t=n+1;t<e.length;t++)r+=w(e[t]);return Math.max(t,r)}function k(e){return O(e)}function A(e,t){return e.length!==t.length||e.some((e,n)=>e!==t[n])}function j(e,t){return t?.roundId?{trigger:e,roundId:t.roundId}:{trigger:e}}function M(e,t,n){try{e.onCompactionStateChange?.(t,n)}catch(e){s.warn(`onCompactionStateChange listener threw`,{error:e instanceof Error?e.message:String(e)})}}function N(e,t,n,r,a,o){let c=x(e,n,r),l=c.messages,u=c.elidedCount,d=c.elidedBytes,f=u>0?T(l):t,p=f>n*a;if(p){let e=S(l,n,r);l=e.messages,u+=e.elidedCount,d+=e.elidedBytes}if(!p&&u===0)return{messages:e,isHopeless:!1,earlyReturn:null};s.warn(`Compaction oversized-message elision`,{totalTokens:t,postSizeTokens:f,contextWindow:n,isHopeless:p,elidedCount:u,elidedBytes:d});let m=i(T(l),n,o)?null:I([],l,n,o);return{messages:l,isHopeless:p,earlyReturn:m}}function P(e){let t=e.content;if(!Array.isArray(t))return e;let n=!1,r=t.map(e=>{let t=e;return t.type===`image`?(n=!0,{type:`text`,text:`[image elided during compaction: ~${Math.max(1,Math.round((t.source?.data??t.data??``).length/1024))} KB. Re-attach or re-read the image if it is still needed.]`}):e});return n?{...e,content:r}:e}function F(e){for(let t=e.length-1;t>=0;t--)if(l(e[t],`user`))return t;return-1}function I(e,t,n,r){let a=F(t),o=t.map((e,t)=>a!==-1&&t>=a?e:P(e));if(i(T([...e,...o]),n,r))for(let t=0;t<o.length;t++){let a=P(o[t]);if(a!==o[t]&&(o=[...o.slice(0,t),a,...o.slice(t+1)],!i(T([...e,...o]),n,r)))break}return o}function L(e,t){let n=0,r=e.length;for(let i=e.length-1;i>=0;i--){let a=w(e[i]);if(n+a>t&&r<e.length)break;n+=a,r=i}for(;r>0&&l(e[r],`toolResult`);)r--;return r<=0||r>=e.length?(s.warn(`Cannot find valid cut point for compaction`),null):{messagesToSummarize:e.slice(0,r),messagesToKeep:u(e.slice(r))}}async function R(e,t,n,r,i){if(!(!e.onMemoryUpdates||e.shouldExtractMemories?.()===!1))try{M(e,`extracting-memory`,i);let a=await _(e.model,t,n,`From the conversation above, extract durable memories worth persisting to a global memory file shared across future sessions.
|
|
12
|
-
|
|
13
|
-
Focus on:
|
|
14
|
-
- User preferences, working style, opinions stated explicitly.
|
|
15
|
-
- Stable project facts (architecture decisions, conventions, constraints).
|
|
16
|
-
- Validated approaches the user accepted ("yes, exactly", "perfect"), not just corrections.
|
|
17
|
-
- External resources/links the user named.
|
|
18
|
-
|
|
19
|
-
DO NOT include:
|
|
20
|
-
- Ephemeral state (current task, in-progress work).
|
|
21
|
-
- Information already obvious from the codebase (file paths, function names, framework conventions).
|
|
22
|
-
- Generic restatements of what the conversation was about.
|
|
23
|
-
|
|
24
|
-
If nothing in the conversation is worth persisting, return exactly the single line:
|
|
25
|
-
NONE
|
|
26
|
-
|
|
27
|
-
Otherwise, output ONLY a markdown bullet list (one bullet per memory), no headers, no preamble, no follow-up. Each bullet is one line. Be specific. Prefer one fact per bullet over multi-clause sentences.`,2048,e.headers,r);if(a?.trim()&&a.trim()!==`NONE`)try{await e.onMemoryUpdates(a.trim()),s.info(`Memory extraction applied`,{bulletsLength:a.length})}catch(e){s.warn(`onMemoryUpdates callback threw`,{error:e instanceof Error?e.message:String(e)})}else s.info(`Memory extraction returned no durable memories`)}catch(e){s.warn(`Memory extraction call failed (compaction still applied)`,{error:e instanceof Error?e.message:String(e)})}}async function z(e,t,n,r,i,a,o,c,l,u){try{let f=x(n,a,i).messages,p=m(d(f)),h=Math.floor(.8*i);M(e,`summarizing`,l);let g=await _(e.model,t,p,`Produce a structured context checkpoint summary of the conversation above that another LLM can use to continue the work.
|
|
28
|
-
|
|
29
|
-
Use this EXACT format:
|
|
30
|
-
|
|
31
|
-
## Goal
|
|
32
|
-
[What is the user trying to accomplish? Can be multiple items if the session covers different tasks.]
|
|
33
|
-
|
|
34
|
-
## Constraints & Preferences
|
|
35
|
-
- [Any constraints, preferences, or requirements mentioned by user]
|
|
36
|
-
- [Or "(none)" if none were mentioned]
|
|
37
|
-
|
|
38
|
-
## Progress
|
|
39
|
-
### Done
|
|
40
|
-
- [x] [Completed tasks/changes]
|
|
41
|
-
|
|
42
|
-
### In Progress
|
|
43
|
-
- [ ] [Current work]
|
|
44
|
-
|
|
45
|
-
### Blocked
|
|
46
|
-
- [Issues preventing progress, if any]
|
|
47
|
-
|
|
48
|
-
## Key Decisions
|
|
49
|
-
- **[Decision]**: [Brief rationale]
|
|
50
|
-
|
|
51
|
-
## Next Steps
|
|
52
|
-
1. [Ordered list of what should happen next]
|
|
53
|
-
|
|
54
|
-
## Critical Context
|
|
55
|
-
- [Any data, examples, or references needed to continue]
|
|
56
|
-
- [Or "(none)" if not applicable]
|
|
57
|
-
|
|
58
|
-
Keep each section concise. Preserve exact file paths, function names, and error messages. Output ONLY the summary, with no preamble or follow-up.`,h,e.headers,c),v={role:`user`,content:[{type:`text`,text:V(`<context-summary>\n${g}\n</context-summary>`,l.transcriptPath)}],timestamp:Date.now()};return s.info(`LLM summarization successful`,{originalMessages:o,compactedMessages:1+r.length,summaryLength:g.length}),u?u(()=>R(e,t,p,void 0,l)):await R(e,t,p,c,l),M(e,`idle`,l),{kind:`summarized`,messages:[v,...r]}}catch(e){let t=g(e);return s.warn(`LLM summarization failed`,{failure:t,error:e instanceof Error?e.message:String(e)}),{kind:`failed`,failure:t}}}async function B(e,t,n){if(e.onBeforeCompaction)try{let r=await e.onBeforeCompaction(t,n);if(r?.transcriptPath)return s.info(`Pre-compaction transcript snapshot written`,{trigger:n,transcriptPath:r.transcriptPath}),r}catch(e){s.warn(`Pre-compaction snapshot hook failed (compaction continues without a pointer)`,{trigger:n,error:e instanceof Error?e.message:String(e)})}}function V(e,t){return t?`${e}\n\nThe full transcript of the conversation before this compaction is saved at ${t} — read it when the summary is not enough.`:e}function H(e,t,n,r,i,a){if(a===!1){let n={...i,failure:`context-too-large`};return s.info(`Idle compaction skipped destructive hopeless-context elision`,{trigger:r,failure:n.failure}),M(e,`cancelled`,n),M(e,`idle`,n),t}return M(e,`summarizing`,i),M(e,`idle`,i),n}async function U(e,t,n,r,i,a,o,c,l,u){if(u)return{kind:`failed`,failure:`context-too-large`};let d=e.getApiKey();return d?z(e,d,t,n,r,i,a,o,c,l?.deferMemoryExtraction):(s.warn(`No API key available for LLM summarization`),{kind:`failed`,failure:`authentication`})}function W(e,t,n,r,i,a,o,c,l,u){if(a?.aborted)return s.info(`Compaction aborted before the fallback drop (history untouched)`,{trigger:c}),M(e,`cancelled`,l),M(e,`idle`,l),t;if(o?.allowNaiveDrop===!1){let n={...l,failure:u};return s.warn(`Compaction summary unavailable; preserving history for a later retry`,{trigger:c,failure:u}),M(e,`cancelled`,n),M(e,`idle`,n),t}M(e,`fallback`,l),M(e,`idle`,l);let d={role:`user`,content:[{type:`text`,text:V(`[Earlier conversation messages were compacted to save context space]`,l.transcriptPath)}],timestamp:Date.now()},f=I([d],n,r,i);return s.info(`Naive compaction applied`,{originalMessages:t.length,compactedMessages:1+f.length}),[d,...f]}function G(e){let t=e.contextWindow??2e5,n=e.reserveTokens??r.reserveTokens,a=e.keepRecentTokens??r.keepRecentTokens,o=e.hopelessMultiplier??4,l={enabled:!0,reserveTokens:n,keepRecentTokens:a};return async(r,u,d)=>{if(r.length===0)return r;let f=O(r);if(!d?.force&&!i(f,t,l))return r;let p=d?.trigger??(d?.force?`overflow`:`threshold`),m=j(p,d),h=await B(e,r,p);h&&(m.transcriptPath=h.transcriptPath);let g=N(r,f,t,n,o,l);if(g.earlyReturn)return c(r,H(e,r,g.earlyReturn,p,m,d?.allowNaiveDrop));let _=g.messages,v=g.isHopeless;s.info(`Context compaction triggered`,{totalTokens:f,contextWindow:t,threshold:t-n,messageCount:_.length});let y=L(_.filter(e=>e.role!==`system`),a);if(!y)return d?.allowNaiveDrop===!1?r:_;let{messagesToSummarize:b,messagesToKeep:x}=y;s.info(`Compaction cut point`,{summarizing:b.length,keeping:x.length});let S=await U(e,b,x,n,t,r.length,u,m,d,v);if(S.kind===`summarized`){let[e,...n]=S.messages;return c(r,[e,...I([e],n,t,l)])}return c(r,W(e,r,x,t,l,u,d,p,m,S.failure))}}export{u as i,k as n,A as r,G as t};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{i as t,n,r,t as i}from"./compat-BAGLwgqY.js";import"./libesm-BypnjKEL.js";import{t as a}from"./logger-DDBAeTLF.js";import{a as o}from"./feature-flags-DvsApnS-.js";import"./proxied-fetch-4VBgrEIu.js";import"./secret-topology-hMRoGGjt.js";import"./secrets-bridge-client-D734Xx8G.js";import"./image-markers-q8JQTtid.js";import"./tool-ui-eSQ1g2I1.js";var s={assign:0,create:0,clone:0,discard:0,update:0};function c(e){return Array.isArray(e)}function l(e){return d(e,null)}function u(e){return d(typeof e,`object`)&&!l(e)}function d(e,t){return e===t}function f(e){if(!u(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!l(t)&&d(typeof t.constructor,`function`)&&!(d(t.constructor,globalThis.Object)||d(t.constructor.name,`Object`))}function p(e){return d(e,`__proto__`)||d(e,`constructor`)||d(e,`prototype`)}function m(e,t){return p(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function h(e){return Object.getOwnPropertyNames(e)}function g(e){return Object.getOwnPropertySymbols(e)}function _(e){return globalThis.ArrayBuffer.isView(e)}function v(e){return e instanceof globalThis.RegExp}function y(e){return e instanceof globalThis.Set}function b(e){return e instanceof globalThis.Map}var x={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function S(){return x}function ee(e){return S().immutableTypes?Object.freeze(e):e}function te(e){return e}function ne(e){return m(e,`~kind`)||m(e,`~unsafe`)}function re(e){let t={};for(let n of h(e)){if(p(n))continue;let r=Object.getOwnPropertyDescriptor(e,n);r.value=C(r.value),d(r.enumerable,!0)?t[n]=r.value:Object.defineProperty(t,n,r)}return t}function ie(e){let t={};for(let n of h(e))p(n)||(t[n]=C(e[n]));for(let n of g(e))t[n]=C(e[n]);return t}function ae(e){return f(e)?te(e):ne(e)?re(e):ie(e)}function oe(e){return e.map(e=>C(e))}function se(e){return e.slice()}function ce(e){return new RegExp(e.source,e.flags)}function le(e){return new Map(C([...e.entries()]))}function ue(e){return new Set(C([...e.values()]))}function C(e){return _(e)?se(e):v(e)?ce(e):b(e)?le(e):y(e)?ue(e):c(e)?oe(e):u(e)?ae(e):e}function de(e){return s.clone+=1,C(e)}function fe(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function pe(e,t){return{...e,...t}}function w(e,t,n={}){s.create+=1;let r=pe(t,n);return ee(S().enumerableKind?pe(r,e):fe(r,e))}function T(e,t,n){s.update+=1;let r=S(),i=de(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return ee(i)}function me(e){return u(e)}function he(e){return T(e,{"~optional":!0},{})}function ge(e,t){return T(he(e),{},t)}function _e(e,t){return w({"~kind":`Array`},{type:`array`,items:e},t)}function ve(e,t={}){return ge(e,t)}function ye(e){return ve(e)}function E(e){return me(e)&&m(e,`~optional`)}function be(e){return h(e).filter(t=>!E(e[t]))}function D(e,t={}){let n=be(e);return w({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}var xe;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(xe||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var Se=new Float64Array(1);new DataView(Se.buffer),new Uint8Array(Se.buffer),new TextEncoder;var Ce=`-?(?:0|[1-9][0-9]*)`,we=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function Te(e){return w({"~kind":`Number`},{type:`number`},e)}function O(e){return w({"~kind":`String`},{type:`string`},e)}var Ee=`^${Ce}$`;`${we}`;function De(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var Oe=[...De(97,122),...De(65,90)],ke=[`0`,...De(49,57)];[...ke],[...Oe,...ke],[...ke],new RegExp(Ee);function Ae(e,t){try{return Promise.resolve(t(je))}catch(e){return Promise.reject(e)}}var je={startSpan:Ae,addEvent:()=>{},setAttributes:()=>{},setStatus:()=>{}};Object.freeze(je);var Me=Object.freeze({token:Symbol(`chord.abortSignal`)}),Ne=class{get abortSignal(){return this.value(Me)}},Pe=class extends Ne{#e;constructor(e){super(),this.#e=e}value(e){}toString(){return this.#e}};new Pe(`[Context BACKGROUND_CONTEXT]`),new Pe(`[Context TODO_CONTEXT]`);function Fe(e){return Object.freeze({token:Symbol(e)})}Fe(`pi.telemetryContext`);var Ie={"pi.session.id":{type:`string`,required:!0,cardinality:`high`,description:`Session id`},"pi.lane.name":{type:`string`,required:!0,cardinality:`high`,description:`Lane name`},"pi.operation.id":{type:`string`,required:!0,cardinality:`high`,description:`Durable operation id`},"pi.operation.recovery":{type:`boolean`,required:!0,description:`Whether this invocation resumes durable work`}},Le={"pi.error.code":{type:`string`,cardinality:`low`,description:`Stable operation error code`},"pi.error.type":{type:`string`,cardinality:`low`,description:`Low-cardinality operation error class`}};({...Ie}),{...Le},{...Ie},{...Le},{...Ie},{...Le};function Re(e,t){if(e.length===0)throw TypeError(`Value namespace must not be empty`);if(e.includes(`\0`))throw TypeError(`Value namespace must not contain \\u0000`);if(t.includes(`\0`))throw TypeError(`Value key must not contain \\u0000`)}function ze(e,t=``){return Re(e,t),Object.freeze({namespace:e,key:t,kind:`value`})}ze(`pi.session.name`);var Be=Symbol.for(`yaml.alias`),Ve=Symbol.for(`yaml.document`),k=Symbol.for(`yaml.map`),He=Symbol.for(`yaml.pair`),Ue=Symbol.for(`yaml.scalar`),A=Symbol.for(`yaml.seq`),j=Symbol.for(`yaml.node.type`),M=e=>!!e&&typeof e==`object`&&e[j]===Be,We=e=>!!e&&typeof e==`object`&&e[j]===Ve,Ge=e=>!!e&&typeof e==`object`&&e[j]===k,N=e=>!!e&&typeof e==`object`&&e[j]===He,P=e=>!!e&&typeof e==`object`&&e[j]===Ue,Ke=e=>!!e&&typeof e==`object`&&e[j]===A;function F(e){if(e&&typeof e==`object`)switch(e[j]){case k:case A:return!0}return!1}function I(e){if(e&&typeof e==`object`)switch(e[j]){case Be:case k:case Ue:case A:return!0}return!1}var qe=e=>(P(e)||F(e))&&!!e.anchor,L=Symbol(`break visit`),Je=Symbol(`skip children`),R=Symbol(`remove node`);function Ye(e,t){let n=Xe(t);We(e)?z(null,e.contents,n,Object.freeze([e]))===R&&(e.contents=null):z(null,e,n,Object.freeze([]))}Ye.BREAK=L,Ye.SKIP=Je,Ye.REMOVE=R;function z(e,t,n,r){let i=Ze(e,t,n,r);if(I(i)||N(i))return Qe(e,r,i),z(e,i,n,r);if(typeof i!=`symbol`){if(F(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=z(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===L)return L;else i===R&&(t.items.splice(e,1),--e)}}else if(N(t)){r=Object.freeze(r.concat(t));let e=z(`key`,t.key,n,r);if(e===L)return L;e===R&&(t.key=null);let i=z(`value`,t.value,n,r);if(i===L)return L;i===R&&(t.value=null)}}return i}function Xe(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Ze(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Ge(t))return n.Map?.(e,t,r);if(Ke(t))return n.Seq?.(e,t,r);if(N(t))return n.Pair?.(e,t,r);if(P(t))return n.Scalar?.(e,t,r);if(M(t))return n.Alias?.(e,t,r)}function Qe(e,t,n){let r=t[t.length-1];if(F(r))r.items[e]=n;else if(N(r))e===`key`?r.key=n:r.value=n;else if(We(r))r.contents=n;else{let e=M(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}function $e(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function B(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=B(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=B(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=B(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=B(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function V(e,t,n){if(Array.isArray(e))return e.map((e,t)=>V(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!qe(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var et=class{constructor(e){Object.defineProperty(this,j,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!We(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=V(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?B(i,{"":o},``,o):o}},tt=class extends et{constructor(e){super(Be),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Ye(e,{Node:(e,t)=>{(M(t)||qe(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(V(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=nt(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if($e(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function nt(e,t,n){if(M(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(F(t)){let r=0;for(let i of t.items){let t=nt(e,i,n);t>r&&(r=t)}return r}if(N(t)){let r=nt(e,t.key,n),i=nt(e,t.value,n);return Math.max(r,i)}return 1}var rt=e=>!e||typeof e!=`function`&&typeof e!=`object`,H=class extends et{constructor(e){super(Ue),this.value=e}toJSON(e,t){return t?.keep?this.value:V(this.value,e,t)}toString(){return String(this.value)}};H.BLOCK_FOLDED=`BLOCK_FOLDED`,H.BLOCK_LITERAL=`BLOCK_LITERAL`,H.PLAIN=`PLAIN`,H.QUOTE_DOUBLE=`QUOTE_DOUBLE`,H.QUOTE_SINGLE=`QUOTE_SINGLE`;var it=`tag:yaml.org,2002:`;function at(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function ot(e,t,n){if(We(e)&&(e=e.contents),I(e))return e;if(N(e)){let t=n.schema[k].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new tt(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=it+t.slice(2));let l=at(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new H(e);return c&&(c.node=t),t}l=e instanceof Map?o[k]:Symbol.iterator in Object(e)?o[A]:o[k]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new H(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function st(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return ot(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var ct=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,lt=class extends et{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>I(t)||N(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ct(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(F(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,st(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(F(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&P(i)?i.value:i:F(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!N(t))return!1;let n=t.value;return n==null||e&&P(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return F(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(F(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,st(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},ut=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function U(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var W=(e,t,n)=>e.endsWith(`
|
|
2
|
-
`)?U(n,t):n.includes(`
|
|
3
|
-
`)?`
|
|
4
|
-
`+U(n,t):(e.endsWith(` `)?``:` `)+n,dt=`flow`,ft=`block`,pt=`quoted`;function mt(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=ht(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
5
|
-
`)n===`block`&&(h=ht(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
6
|
-
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
7
|
-
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function ht(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
8
|
-
`);r=t,i=t+1,a=e[i]}return r}var gt=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),_t=e=>/^(%|---|\.\.\.)/m.test(e);function vt(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
9
|
-
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function yt(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(_t(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
10
|
-
|
|
11
|
-
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
12
|
-
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:mt(o,a,pt,gt(t,!1))}function bt(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
13
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return yt(e,t);let n=t.indent||(_t(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:mt(r,n,dt,gt(t,!1))}function G(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=yt;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?bt:i&&!t?yt:n?bt:yt}return r(e,t)}var xt;try{xt=RegExp(`(^|(?<!
|
|
14
|
-
))
|
|
15
|
-
+(?!
|
|
16
|
-
|$)`,`g`)}catch{xt=/\n+(?!\n|$)/g}function St({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return G(n,r);let l=r.indent||(r.forceBlockIndent||_t(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===H.BLOCK_FOLDED?!1:t===H.BLOCK_LITERAL||!vt(n,c,l.length);if(!n)return u?`|
|
|
17
|
-
`:`>
|
|
18
|
-
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
19
|
-
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
20
|
-
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
21
|
-
`&&(p=p.slice(0,-1)),p.replace(xt,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
22
|
-
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
23
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=gt(r,!0);o!==`folded`&&t!==H.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=mt(`${v}${e}${p}`,l,ft,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Ct(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
24
|
-
`)||u&&/[[\]{},]/.test(a))return G(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
25
|
-
`)?G(a,t):St(e,t,n,r);if(!s&&!u&&i!==H.PLAIN&&a.includes(`
|
|
26
|
-
`))return St(e,t,n,r);if(_t(a)){if(c===``)return t.forceBlockIndent=!0,St(e,t,n,r);if(s&&c===l)return G(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return G(a,t)}return s?d:mt(d,c,dt,gt(t,!1))}function wt(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==H.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=H.QUOTE_DOUBLE);let c=e=>{switch(e){case H.BLOCK_FOLDED:case H.BLOCK_LITERAL:return i||a?G(o.value,t):St(o,t,n,r);case H.QUOTE_DOUBLE:return yt(o.value,t);case H.QUOTE_SINGLE:return bt(o.value,t);case H.PLAIN:return Ct(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Tt(e,t){let n=Object.assign({blockQuote:!0,commentString:ut,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Et(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(P(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Dt(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(P(e)||F(e))&&e.anchor;a&&$e(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function Ot(e,t,n,r){if(N(e))return e.toString(t,n,r);if(M(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=I(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=Et(t.doc.schema.tags,a);let o=Dt(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):P(a)?wt(a,t,n,r):a.toString(t,n,r);return o?P(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function kt({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=I(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(F(e)||!I(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||F(e)||(P(e)?e.type===H.BLOCK_FOLDED||e.type===H.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=Ot(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=W(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=W(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=W(g,n.indent,l(f))));let _,v,y;I(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&P(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Ke(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=Ot(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
27
|
-
`:``,v){let e=l(v);S+=`\n${U(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
28
|
-
`&&y&&(S=`
|
|
29
|
-
|
|
30
|
-
`):S+=`\n${n.indent}`}else if(!p&&F(t)){let e=x[0],r=x.indexOf(`
|
|
31
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
|
32
|
-
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=W(g,n.indent,l(y)):h&&i&&i(),g}function At(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var jt=`<<`,Mt={identify:e=>e===jt||typeof e==`symbol`&&e.description===jt,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new H(Symbol(jt)),{addToJSMap:Pt}),stringify:()=>jt},Nt=(e,t)=>(Mt.identify(t)||P(t)&&(!t.type||t.type===H.PLAIN)&&Mt.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Mt.tag&&e.default);function Pt(e,t,n){let r=It(e,n);if(Ke(r))for(let n of r.items)Ft(e,t,n);else if(Array.isArray(r))for(let n of r)Ft(e,t,n);else Ft(e,t,r)}function Ft(e,t,n){let r=It(e,n);if(!Ge(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function It(e,t){return e&&M(t)?t.resolve(e.doc,e):t}function Lt(e,t,{key:n,value:r}){if(I(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Nt(e,n))Pt(e,t,r);else{let i=V(n,``,e);if(t instanceof Map)t.set(i,V(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Rt(n,i,e),o=V(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Rt(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(I(e)&&n?.doc){let t=Tt(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),At(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function zt(e,t,n){return new K(ot(e,void 0,n),ot(t,void 0,n))}var K=class e{constructor(e,t=null){Object.defineProperty(this,j,{value:He}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return I(n)&&(n=n.clone(t)),I(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Lt(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?kt(this,e,t,n):JSON.stringify(this)}};function Bt(e,t,n){return(t.inFlow??e.flow?Ht:Vt)(e,t,n)}function Vt({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(I(i))!d&&i.spaceBefore&&f.push(``),Ut(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(N(i)){let e=I(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Ut(n,f,e.commentBefore,d))}d=!1;let s=Ot(i,u,()=>o=null,()=>d=!0);o&&(s+=W(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
33
|
-
`}}return e?(p+=`
|
|
34
|
-
`+U(l(e),c),s&&s()):d&&o&&o(),p}function Ht({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(I(i))i.spaceBefore&&d.push(``),Ut(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(N(i)){let e=I(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Ut(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=I(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=Ot(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
35
|
-
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=W(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
36
|
-
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Ut({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=U(t(r),e);n.push(i.trimStart())}}function q(e,t){let n=P(t)?t.value:t;for(let r of e)if(N(r)&&(r.key===t||r.key===n||P(r.key)&&r.key.value===n))return r}var J=class extends lt{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(k,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(zt(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=N(e)?e:!e||typeof e!=`object`||!(`key`in e)?new K(e,e?.value):new K(e.key,e.value);let r=q(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);P(r.value)&&rt(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=q(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=q(this.items,e)?.value;return(!t&&P(n)?n.value:n)??void 0}has(e){return!!q(this.items,e)}set(e,t){this.add(new K(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Lt(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!N(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Bt(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Wt={collection:`map`,default:!0,nodeClass:J,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Ge(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>J.from(e,t,n)},Gt=class extends lt{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(A,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Kt(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Kt(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&P(r)?r.value:r}has(e){let t=Kt(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Kt(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];P(r)&&rt(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(V(e,String(r++),t));return n}toString(e,t,n){return e?Bt(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(ot(a,void 0,n))}}return i}};function Kt(e){let t=P(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var qt={collection:`seq`,default:!0,nodeClass:Gt,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Ke(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Gt.from(e,t,n)};function Jt(e){return typeof e==`bigint`||Number.isInteger(e)}var Yt=({value:e})=>JSON.stringify(e),Xt=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Yt},{identify:e=>e==null,createNode:()=>new H(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Yt},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Yt},{identify:Jt,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Jt(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Yt}];[Wt,qt].concat(Xt,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Zt(e,t,n){let{replacer:r}=n,i=new Gt(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(zt(o,s,n))}return i}var Qt=class e extends Gt{constructor(){super(),this.add=J.prototype.add.bind(this),this.delete=J.prototype.delete.bind(this),this.get=J.prototype.get.bind(this),this.has=J.prototype.has.bind(this),this.set=J.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(N(e)?(r=V(e.key,``,t),i=V(e.value,r,t)):r=V(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Zt(e,t,n),i=new this;return i.items=r.items,i}};Qt.tag=`tag:yaml.org,2002:omap`;var $t=class e extends J{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=N(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new K(e.key,null):new K(e,null),q(this.items,t.key)||this.items.push(t)}get(e,t){let n=q(this.items,e);return!t&&N(n)?P(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=q(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new K(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(zt(e,null,n));return i}};$t.tag=`tag:yaml.org,2002:set`;var en=Symbol(`break visit`),tn=Symbol(`skip children`),nn=Symbol(`remove item`);function Y(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),rn(Object.freeze([]),e,t)}Y.BREAK=en,Y.SKIP=tn,Y.REMOVE=nn,Y.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Y.parentCollection=(e,t)=>{let n=Y.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function rn(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=rn(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===en)return en;else r===nn&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}e(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=/[.*+?()[\]{}^$|\\/]/,i=/^ +$/,a=/(?:[^\\]|^)\\$/,o=/^\\!/,s=/^\\#/,c=/\r?\n/g,l=`/`,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));var d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=()=>!1,m=e=>{let{length:t}=e;return e.slice(0,t-t%2)},h={alnum:`0-9A-Za-z`,alpha:`A-Za-z`,blank:` \\t`,cntrl:`\\x00-\\x1f\\x7f`,digit:`0-9`,graph:`!-.0-~`,lower:`a-z`,print:` -.0-~`,punct:"!-.:-@\\[-`{-~",space:` \\t\\n\\r`,upper:`A-Z`,xdigit:`0-9A-Fa-f`},g=`\\]^-[`,_=e=>g.indexOf(e)<0?e:`\\`+e,v=`(?!\\/)`,y=(e,t)=>{if(e)return`[^\\/${t}]`;let n=`[${t}]`;return new RegExp(n).test(`/`)?v+n:n},b=(e,t)=>{let{length:n}=e,r=t+1,i=``,a=e[r];(a===`!`||a===`^`)&&(i=`^`,r++);let o=``,s=``;for(;;){let t=e[r];if(t===void 0)return null;if(t===`\\`){let t=e[r+1];if(t===void 0)return null;o+=_(t),s=t,r++}else if(t===`-`&&s&&r+1<n&&e[r+1]!==`]`){r++;let t=e[r];t===`\\`&&(t=e[r+=1]),s<=t&&(o+=`-${_(t)}`),s=``}else if(t===`[`&&e[r+1]===`:`){let t=r+2,i=t;for(;i<n&&e[i]!==`]`;)i++;if(i===n)return null;if(i>t&&e[i-1]===`:`){let n=h[e.slice(t,i-1)];if(n===void 0)return null;o+=n,s=``,r=i}else o+=_(`[`),s=`[`,r=t-2}else o+=_(t),s=t;if(r++,e[r]===`]`)return{end:r,source:y(i,o)}}},x=`[]`,S=`\0`,ee=RegExp(`${S}(\\d+)${S}`,`g`),te=``,ne=e=>{let t=[],n=e=>`${S}${t.push(e)-1}${S}`,{length:i}=e,a=``,o=0;for(;o<i;){let t=e[o];if(t===`\\`){let t=e[o+1];a+=t===`*`||t===`[`||t===` `||t===`\\`?e.slice(o,o+2):n(r.test(t)?`\\`+t:t),o+=2}else if(t===S)a+=n(`[${S}]`),o++;else if(t===`[`){let t=b(e,o);t===null?(a+=n(x),o=i):(a+=n(t.source),o=t.end+1)}else a+=t,o++}return{source:a,sources:t}},re=null,ie=/\/(?!$)/,ae=[[/^\uFEFF/,()=>``,``],[/[\r\n]+$/,()=>``],[/((?:\\\\)*?)(\\? +)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?) /g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`,`?`],[/^\//,()=>`^`,l],[/\//g,()=>`\\/`,l],[/^\^*(?:\\\*\\\*\\\/)+/,()=>`^(?:.*\\/)?`,`*`],[re,(e,t)=>!e||e[0]===`^`?e:(ie.test(t)?`^`:`(?:^|\\/)`)+e],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?n.slice(t+6)===`\\/`?`(?:\\/[^\\/]+)+`:`(?:\\/[^\\/]+)*`:`\\/.+`,`*`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`),`*`],[/(^|[^\\])((?:\\\\)*)\\\*$/,(e,t,n)=>n.length/2%2==0?t+n+te:e,`*`],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`,`\\\\`],[/\\\\/g,()=>`\\`,`\\\\`],[/\\\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r)=>`\\[${t}${m(n)}${r}`,`[`],[re,e=>{let t=e[e.length-1];return!t||t===te?e:t===l?`${e}$`:`${e}(?=$|\\/$)`}]],oe=/(^|\\\/)?\uE000$/,se=`regex`,ce=`checkRegex`,le={[se](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[ce](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},ue=`[^\\/]*`,C=e=>{if(e.indexOf(ue)<0)return e;let t=[],{length:n}=e,r=0;for(;r<n;){let i=e[r];if(e.startsWith(ue,r))t.push({wildcard:!0}),r+=6;else if(i===`[`){let i=r+1;for(e[i]===`^`&&i++,e[i]===`]`&&i++;i<n&&e[i]!==`]`;)i+=e[i]===`\\`?2:1;i++,t.push({single:e.slice(r,i)}),r=i}else if(i===`\\`)t.push({single:e.slice(r,r+2)}),r+=2;else if(i===`(`){let i=0,a=r;do e[a]===`\\`?a++:e[a]===`(`?i++:e[a]===`)`&&i--,a++;while(a<n&&i>0);`*+?`.indexOf(e[a])>=0&&a++,t.push({boundary:e.slice(r,a)}),r=a}else i===`^`||i===`$`?(t.push({boundary:i}),r++):(t.push({single:i}),r++)}let i=``,a=[],o=()=>{let e;a.forEach((t,n)=>{t.wildcard&&(e=n)}),a.forEach((t,n)=>{if(!t.wildcard){i+=t.single;return}i+=n===e?ue:`(?:(?!${a[n+1].single})[^\\/])*`}),a=[]};return t.forEach(e=>{if(e.boundary===void 0){a.push(e);return}o(),i+=e.boundary}),o(),i},de=e=>{let{source:t,sources:n}=ne(e),r=ae.reduce((t,[n,r,i])=>n===re?r(t,e):i!==void 0&&t.indexOf(i)<0?t:n.test(t)?t.replace(n,r.bind(e)):t,t);return n.length?r.replace(ee,(e,t)=>n[t]):r},fe=e=>{let t=e.indexOf(l);return t<0||t===e.length-1},pe=e=>{let t=e.length-1,n=e.lastIndexOf(l,e[t]===l?t-1:t);return n<0?e:e.slice(n+1)},w=e=>{if(e.charCodeAt(0)===47||e.indexOf(`//`)>=0){let t=e.split(l).filter(Boolean);return t.pop(),t.length?t.join(l)+l:``}let t=e.length-1,n=e.lastIndexOf(l,e.charCodeAt(t)===47?t-1:t);return n<0?``:e.slice(0,n+1)},T=e=>typeof e==`string`,me=e=>e&&T(e)&&!i.test(e)&&!a.test(e)&&e.indexOf(`#`)!==0,he=e=>e.split(c).filter(Boolean),ge=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get _basenameOnly(){return f(this,`_basenameOnly`,fe(this.body))}get regex(){let e=`_regex`;return this[e]?this[e]:this._make(se,e)}get checkRegex(){let e=`_checkRegex`;return this[e]?this[e]:this._make(ce,e)}_make(e,t){let n=C(this.regexPrefix.replace(oe,le[e])),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}},_e=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(o,`!`).replace(s,`#`);let a=de(i);return new ge(e,t,i,n,r,a)},ve=class{constructor(e){this._ignoreCase=e,this._rules=[],this._basenameCount=0}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._basenameCount+=e._rules._basenameCount,this._added=!0;return}if(T(e)&&(e={pattern:e}),me(e.pattern)){let t=_e(e,this._ignoreCase);this._added=!0,this._rules.push(t),fe(t.body)&&this._basenameCount++}}add(e){return this._added=!1,n(T(e)?he(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a,o=this._rules,{length:s}=o,c=this._basenameCount*2>=s,l=c?pe(e):e;for(let u=0;u<s;u++){let s=o[u],{negative:d}=s;!(i===d&&r!==i||d&&!r&&!i&&!t)&&s[n].test(c&&s._basenameOnly?l:e)&&(r=!d,i=d,a=d?void 0:s)}let u={ignored:r,unignored:i};return a&&(u.rule=a),u}},ye=(e,t)=>{throw new t(e)},E=(e,t,n)=>T(e)?e?!E.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),be=e=>{let t=e.charCodeAt(0);if(t===47)return!0;if(t!==46)return!1;if(e.length===1)return!0;let n=e.charCodeAt(1);return n===47?!0:n===46?e.length===2||e.charCodeAt(2)===47:!1};E.isNotRelative=be,E.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new ve(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n){let r=e&&E.convert(e);return E(r,e,this._strictPathCheck?ye:p),this._t(r,t,n)}checkIgnore(e){if(e.charCodeAt(e.length-1)!==47)return this.test(e);let t=w(e);if(t){let e=this._t(t,this._testCache,!0);if(e.ignored)return e}return this._rules.test(e,!1,ce)}_t(e,t,n){if(e in t)return t[e];let r=w(e),i=r?this._t(r,t,n):void 0;return t[e]=i&&i.ignored?i:this._rules.test(e,n,se)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},xe=e=>new D(e),Se=e=>E(e&&E.convert(e),e,p),Ce=()=>{E.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;E.isNotRelative=t=>e.test(t)||be(t)};typeof process<`u`&&process.platform===`win32`&&Ce(),t.exports=xe,xe.default=xe,t.exports.isPathValid=Se,f(t.exports,Symbol.for(`setupWindows`),Ce)}))(),globalThis.Buffer,new TextEncoder,new TextDecoder,D({command:O({description:`Bash command to execute`}),timeout:ye(Te({description:`Timeout in seconds (optional, no default timeout)`}))});var an=D({oldText:O({description:`Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call.`}),newText:O({description:`Replacement text for this targeted edit.`})},{});D({path:O({description:`Path to the file to edit (relative or absolute)`}),edits:_e(an,{description:`One or more targeted replacements. Each edit is matched against the original file, not incrementally. Do not include overlapping or nested edits. If two changes touch the same block or nearby lines, merge them into one edit instead.`})},{}),D({path:O({description:`Path to the file to read (relative or absolute)`}),offset:ye(Te({description:`Line number to start reading from (1-indexed)`})),limit:ye(Te({description:`Maximum number of lines to read`}))}),D({path:O({description:`Path to the file to write (relative or absolute)`}),content:O({description:`Content to write to the file`})}),a(`context-compaction`);function on(e){let t=[];for(let n of e){let e=n;switch(e.role){case`user`:t.push(`<user>\n${cn(e.content)}\n</user>`);break;case`assistant`:t.push(`<assistant>\n${cn(e.content)}\n</assistant>`);break;case`toolResult`:{let n=e.toolName??`tool`;t.push(`<tool-result name="${n}">\n${cn(e.content)}\n</tool-result>`);break}case`bashExecution`:t.push(`<bash>\n$ ${e.command??``}\n${e.output??``}\n</bash>`);break;case`branchSummary`:case`compactionSummary`:t.push(`<prior-summary>\n${e.summary??``}\n</prior-summary>`);break;default:t.push(`<${e.role}>\n${cn(e.content)}\n</${e.role}>`)}}return t.join(`
|
|
37
|
-
|
|
38
|
-
`)}var sn=/\n*The full transcript of the conversation before this compaction is saved at \S+ — read it when the summary is not enough\.?/g;function cn(e){if(typeof e==`string`)return e.replace(sn,``);if(!Array.isArray(e))return``;let t=[];for(let n of e){let e=n;e.type===`text`&&e.text?t.push(e.text.replace(sn,``)):e.type===`thinking`&&e.thinking?t.push(`[thinking] ${e.thinking}`):e.type===`toolCall`?t.push(`[tool-call ${e.name??`?`}] ${JSON.stringify(e.arguments??{})}`):e.type===`image`&&t.push(`[image]`)}return t.join(`
|
|
39
|
-
`)}var ln=`From the conversation above, extract durable memories worth persisting to a global memory file shared across future sessions.
|
|
40
|
-
|
|
41
|
-
Focus on:
|
|
42
|
-
- User preferences, working style, opinions stated explicitly.
|
|
43
|
-
- Stable project facts (architecture decisions, conventions, constraints).
|
|
44
|
-
- Validated approaches the user accepted ("yes, exactly", "perfect"), not just corrections.
|
|
45
|
-
- External resources/links the user named.
|
|
46
|
-
|
|
47
|
-
DO NOT include:
|
|
48
|
-
- Ephemeral state (current task, in-progress work).
|
|
49
|
-
- Information already obvious from the codebase (file paths, function names, framework conventions).
|
|
50
|
-
- Generic restatements of what the conversation was about.
|
|
51
|
-
|
|
52
|
-
If nothing in the conversation is worth persisting, return exactly the single line:
|
|
53
|
-
NONE
|
|
54
|
-
|
|
55
|
-
Otherwise, output ONLY a markdown bullet list (one bullet per memory), no headers, no preamble, no follow-up. Each bullet is one line. Be specific. Prefer one fact per bullet over multi-clause sentences.`;function un(e){return`You are a context compaction assistant. You are shown the prefix of a conversation between a user and an AI coding assistant, and asked to produce either a structured summary, durable memory bullets, or a short title — depending on the user's instruction.
|
|
56
|
-
|
|
57
|
-
Do NOT continue the conversation. Do NOT answer questions inside the conversation. Output ONLY what the user asks for in the format specified.
|
|
58
|
-
|
|
59
|
-
<conversation>
|
|
60
|
-
${e}
|
|
61
|
-
</conversation>`}var X=class extends Error{failure;constructor(e,t){super(t),this.failure=e,this.name=`CompactionCallError`}};function dn(e){if(e instanceof X)return e.failure;let t=typeof e==`object`&&e?e:void 0,n=t?.status??t?.statusCode??t?.code,r=typeof t?.message==`string`?t.message.toLowerCase():String(e).toLowerCase();return n===429||n===`429`||/rate[ -]?limit|too many requests|throttl/.test(r)?`rate-limit`:/quota|credit|budget|billing|allowance|resource exhausted/.test(r)?`quota-exhausted`:n===401||n===`401`||/unauthori[sz]ed|authentication|invalid api.?key|invalid x-api-key|session expired/.test(r)?`authentication`:typeof n==`number`&&n>=500||typeof n==`string`&&/^5\d\d$/.test(n)||/service unavailable|provider unavailable|overloaded|outage|timed? out|timeout|network|fetch failed|connection/.test(r)?`provider-unavailable`:`unknown`}async function fn(e,t,n,r,a,o,s){let c=await i(e,{systemPrompt:n,messages:[{role:`user`,content:[{type:`text`,text:r}],timestamp:Date.now()}]},{maxTokens:a,apiKey:t,headers:o,signal:s});if(typeof c!=`object`||!c)throw new X(`invalid-response`,`Compaction call returned no response`);let l=c;if(typeof l.stopReason!=`string`||!Array.isArray(l.content))throw new X(`invalid-response`,`Compaction call returned an invalid response envelope`);if(l.stopReason===`error`){let e=typeof l.errorMessage==`string`?l.errorMessage:`Unknown provider error`;throw new X(dn(Error(e)),`Compaction call failed: ${e}`)}let u=l.content.filter(e=>typeof e==`object`&&!!e&&e.type===`text`);if(u.some(e=>typeof e.text!=`string`))throw new X(`invalid-response`,`Compaction call returned an invalid text block`);let d=u.map(e=>e.text).join(`
|
|
62
|
-
`).trim();if(!d)throw new X(`empty-response`,`Compaction call returned no summary text`);return d}async function pn(e){let t=un(on(e.messages));return fn(e.model,e.apiKey,t,e.instruction,e.maxTokens,e.headers,e.signal)}var mn=ln,hn=`Generate a short title (3 to 6 words) summarizing what this conversation was about. Output ONLY the title text — no quotes, no punctuation other than what belongs in the title, no preamble.`,gn=`slicc_model_catalog`;function _n(){try{return globalThis.localStorage??null}catch{return null}}function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Q(e,t){return Reflect.get(e,t)}function vn(e){let t=null;try{t=e?.getItem(`slicc_model_catalog`)??null}catch{return{raw:null,store:{}}}if(!t)return{raw:t,store:{}};try{let e=JSON.parse(t);return{raw:t,store:Z(e)?e:{}}}catch{return{raw:t,store:{}}}}function $(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0}function yn(e){if(!Z(e))return null;let t=Q(e,`input`),n=Q(e,`output`),r=Q(e,`cacheRead`),i=Q(e,`cacheWrite`);return!$(t)||!$(n)||!$(r)||!$(i)?null:{input:t,output:n,cacheRead:r,cacheWrite:i}}function bn(e){return!Array.isArray(e)||e.length===0||!e.every(e=>e===`text`||e===`image`)?null:[...e]}function xn(e){if(e===void 0)return;if(!Z(e))return null;let t=Object.entries(e);return t.every(([,e])=>e===null||typeof e==`string`)?Object.fromEntries(t):null}function Sn(e){return{apis:new Set(e.map(e=>e.api)),baseUrls:new Set(e.map(e=>e.baseUrl))}}function Cn(e,t,n){if(!Z(t))return null;let r=Q(t,`id`),i=Q(t,`name`),a=Q(t,`api`),o=Q(t,`baseUrl`),s=Q(t,`reasoning`),c=Q(t,`contextWindow`),l=Q(t,`maxTokens`);if(typeof r!=`string`||r.length===0||r.length>200||typeof i!=`string`||i.length===0||typeof a!=`string`||!n.apis.has(a)||typeof o!=`string`||!n.baseUrls.has(o)||typeof s!=`boolean`||!$(c)||c===0||!$(l)||l===0)return null;let u=yn(Q(t,`cost`)),d=bn(Q(t,`input`)),f=xn(Q(t,`thinkingLevelMap`));if(!u||!d||f===null)return null;let p=Q(t,`compat`),m={id:r,name:i,api:a,provider:e,baseUrl:o,reasoning:s,input:d,cost:u,contextWindow:c,maxTokens:l};return f&&(m.thinkingLevelMap=f),Z(p)&&(m.compat={...p}),m}function wn(){return 1790795820024}var Tn,En=new Map;function Dn(e){try{return r(e)}catch{return[]}}function On(e){if(!e||!Array.isArray(e.models)||e.models.length===0)return!1;let t=wn();return t===null||typeof e.lastModified==`number`&&e.lastModified>t}var kn=new Set([`id`,`name`,`api`,`provider`,`baseUrl`,`reasoning`,`input`,`cost`,`contextWindow`,`maxTokens`,`thinkingLevelMap`,`compat`]);function An(e,t,n){if(t)return{...Object.fromEntries(Object.entries(t).filter(([e])=>!kn.has(e))),...e};let r=n.find(t=>t.headers&&t.api===e.api&&t.baseUrl===e.baseUrl);return r?.headers?{...e,headers:{...r.headers}}:e}function jn(e,t){let n=Dn(e);if(n.length===0)return n;let r=Sn(n),i=[...n],a=new Map(i.map((e,t)=>[e.id,t])),o=new Map(n.map(e=>[e.id,e]));for(let s of t.models){let t=Cn(e,s,r);if(!t)continue;let c=a.get(t.id),l=An(t,o.get(t.id),n);c===void 0?(a.set(l.id,i.length),i.push(l)):i[c]=l}return i}function Mn(e,t){if(!o(`live-model-catalog`))return Dn(e);let{raw:n,store:r}=vn(t),i=r[e];if(!On(i))return Dn(e);n!==Tn&&(Tn=n,En=new Map);let a=En.get(e);return a||(a=jn(e,i),En.set(e,a)),a}function Nn(e){return[...Mn(e,_n())]}function Pn(e,t){return Mn(e,_n()).find(e=>e.id===t)||n(e,t)}var Fn=t;a(`secret-scrub`),a(`image-processor`),a(`tool-adapter`);export{Nn as a,vn as c,pn as d,Pn as i,mn as l,_n as n,Fn as o,Q as r,Z as s,gn as t,hn as u};
|