sliccy 6.190.0 → 6.192.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/node-server/_shared/tray-sync-protocol.d.ts +22 -1
  2. package/dist/node-server/_shared/tray-sync-protocol.d.ts.map +1 -1
  3. package/dist/node-server/_shared/tray-sync-protocol.js +5 -1
  4. package/dist/node-server/_shared/tray-sync-protocol.js.map +1 -1
  5. package/dist/ui/.vite/manifest.json +202 -200
  6. package/dist/ui/assets/{CLAUDE-BMBoR1hd.js → CLAUDE-Cp-Dty1s.js} +1 -1
  7. package/dist/ui/assets/{MEMORY-Dl8Y_nOo.js → MEMORY-CbB3xjAS.js} +1 -1
  8. package/dist/ui/assets/__vite-browser-external-CnFJWAkm.js +1 -0
  9. package/dist/ui/assets/account-store-Bevys7WL.js +2 -0
  10. package/dist/ui/assets/account-store-irTFXEHq.js +1 -0
  11. package/dist/ui/assets/{adobe-DAk5mRTR.js → adobe-C2Yk0FjU.js} +1 -1
  12. package/dist/ui/assets/{adobe-CMB6BAX8.js → adobe-CxPY_Nvf.js} +1 -1
  13. package/dist/ui/assets/{agent-panels-BLEQfwy2.js → agent-panels-CDAHwcGe.js} +1 -1
  14. package/dist/ui/assets/{almost-bash-shell-headless-B40I6EzY.js → almost-bash-shell-headless-B6lKPYip.js} +41 -38
  15. package/dist/ui/assets/{apply-layout-D4hoY6q2.js → apply-layout-BaPTlEmq.js} +1 -1
  16. package/dist/ui/assets/{apps-oTATee4K.js → apps-CWLDElDt.js} +1 -1
  17. package/dist/ui/assets/{azure-openai-BUzdslaw.js → azure-openai-BrEMU1w0.js} +1 -1
  18. package/dist/ui/assets/{azure-openai-vgxsDn6T.js → azure-openai-CAmcCxYK.js} +1 -1
  19. package/dist/ui/assets/{backend-hostfs-DyW6kRxx.js → backend-hostfs-DVOOQmWO.js} +1 -1
  20. package/dist/ui/assets/bedrock-camp-CMfZujT_.js +1 -0
  21. package/dist/ui/assets/bedrock-camp-Ck_nFSMy.js +1 -0
  22. package/dist/ui/assets/bedrock-camp-compat-Bdpnq7TU.js +1 -0
  23. package/dist/ui/assets/bedrock-camp-compat-Bz7u6y4g.js +1 -0
  24. package/dist/ui/assets/bedrock-camp-extra-models-D5MhCrhJ.js +1 -0
  25. package/dist/ui/assets/bedrock-camp-extra-models-IBZyfEdZ.js +1 -0
  26. package/dist/ui/assets/{browser-BPbYUZ91.js → browser-DL3zbJrM.js} +10 -11
  27. package/dist/ui/assets/{bsh-watchdog-CmaS7wa9.js → bsh-watchdog-CCz8gp5d.js} +1 -1
  28. package/dist/ui/assets/buffer-polyfill-BwLbCySD.js +1 -0
  29. package/dist/ui/assets/{cdp-BBXpHC3W.js → cdp-l5Vq6Mtp.js} +1 -1
  30. package/dist/ui/assets/{cerebras-DUTPWZ3a.js → cerebras-COJ_qkGu.js} +1 -1
  31. package/dist/ui/assets/{cerebras-Bm9kz-h8.js → cerebras-DyJkWRm7.js} +1 -1
  32. package/dist/ui/assets/{composer-speech-D0uHFdYf.js → composer-speech-CYdWOXqF.js} +1 -1
  33. package/dist/ui/assets/{connect-surface-Gme43nbM.js → connect-surface-DnaS1qCD.js} +1 -1
  34. package/dist/ui/assets/{core-BfCKeVcE.js → core-PJsXG3mm.js} +1 -1
  35. package/dist/ui/assets/{cost-command-BQTDpqWV.js → cost-command-DC0JwdLM.js} +1 -1
  36. package/dist/ui/assets/{directed-approval-C-N4Lyz-.js → directed-approval-Bo1zb-ki.js} +1 -1
  37. package/dist/ui/assets/emscripten-vfs-hook-DORb16y9.js +1 -0
  38. package/dist/ui/assets/{emscripten-vfs-hook-DNWfHxzZ.js → emscripten-vfs-hook-jxmK_i72.js} +1 -1
  39. package/dist/ui/assets/{ensure-speech-assets-CslAjHHs.js → ensure-speech-assets-DXQUrOok.js} +1 -1
  40. package/dist/ui/assets/{esbuild-wasm-CeZYVyQ9.js → esbuild-wasm-CbTVjIj0.js} +1 -1
  41. package/dist/ui/assets/{ffmpeg-wasm-CV1BmGNS.js → ffmpeg-wasm-CmLVzRDe.js} +1 -1
  42. package/dist/ui/assets/{frozen-archive-writer-Bzn2q24C.js → frozen-archive-writer-C_qn0GDJ.js} +1 -1
  43. package/dist/ui/assets/{fs-DnLOvvvT.js → fs-D5UZBrBX.js} +1 -1
  44. package/dist/ui/assets/{fs-D1Dp_Ep1.js → fs-DouF0VP9.js} +2 -2
  45. package/dist/ui/assets/{gelatiere-store-BzLpmCkk.js → gelatiere-store-D0SzDyoX.js} +1 -1
  46. package/dist/ui/assets/{gelatiere-unit-CWRGe17z.js → gelatiere-unit-D0eC3q8k.js} +1 -1
  47. package/dist/ui/assets/{github-DWvM7A3I.js → github-CMMdXD7-.js} +1 -1
  48. package/dist/ui/assets/{github-CiP7BlgM.js → github-DrXxnqrr.js} +2 -2
  49. package/dist/ui/assets/{github-auth-Bw46MVyY.js → github-auth-CVs8hOEW.js} +1 -1
  50. package/dist/ui/assets/{github-copilot-Cw6ggpYJ.js → github-copilot-BDW-hvGU.js} +1 -1
  51. package/dist/ui/assets/{github-copilot-DPCFqh6W.js → github-copilot-F_OWE6ig.js} +1 -1
  52. package/dist/ui/assets/{github-install-BMRS10U5.js → github-install-B-rr32FO.js} +1 -1
  53. package/dist/ui/assets/{github-zip-BuNrfmPG.js → github-zip-DA_-VtNu.js} +1 -1
  54. package/dist/ui/assets/{guest-tool-gate-XJ21QL4L.js → guest-tool-gate-CaXA5eEm.js} +1 -1
  55. package/dist/ui/assets/{hear-C9TMsdyp.js → hear-B1QjKHJS.js} +1 -1
  56. package/dist/ui/assets/{help-CT-6K18M.js → help-C3q6Ha5a.js} +1 -1
  57. package/dist/ui/assets/{host-command-AyzKgQLr.js → host-command-DTM6_CU_.js} +1 -1
  58. package/dist/ui/assets/{installer-BqstqF0q.js → installer-BamTBGiN.js} +1 -1
  59. package/dist/ui/assets/{interrupted-work-recovery-DvvxB451.js → interrupted-work-recovery-4r2qWReh.js} +1 -1
  60. package/dist/ui/assets/{js-realm-worker-By6mzrxF.js → js-realm-worker-CIzPgKVU.js} +14 -14
  61. package/dist/ui/assets/{jsh-executor-DkQ_pn3q.js → jsh-executor-8n8-NVRR.js} +4 -4
  62. package/dist/ui/assets/{kernel-worker-Cp4UmRK8.js → kernel-worker-YhNfUQ_y.js} +57 -57
  63. package/dist/ui/assets/{lick-ws-bridge-4OMsthUP.js → lick-ws-bridge-BWmnM4i8.js} +1 -1
  64. package/dist/ui/assets/{lick-ws-bridge-Di__mYYU.js → lick-ws-bridge-CDPuY-EA.js} +1 -1
  65. package/dist/ui/assets/{live-session-curation-Df4vTXXp.js → live-session-curation-eGH4uyM1.js} +1 -1
  66. package/dist/ui/assets/{live-session-snapshot-DMDS-wW3.js → live-session-snapshot-CAY9GlTD.js} +1 -1
  67. package/dist/ui/assets/live-vfs-fs-CX95TogC.js +1 -0
  68. package/dist/ui/assets/{local-llm-DvXzOnVy.js → local-llm-CsIWLXJ2.js} +1 -1
  69. package/dist/ui/assets/{local-llm-w0RCshcM.js → local-llm-dPetWUMs.js} +1 -1
  70. package/dist/ui/assets/{magick-wasm-KFp97Nzb.js → magick-wasm-BATj-KUu.js} +1 -1
  71. package/dist/ui/assets/{main-BZ7qq-Vs.js → main-DUD5pTDH.js} +3 -3
  72. package/dist/ui/assets/{main-cherry-npF7LwF_.js → main-cherry-BoO4BB-J.js} +1 -1
  73. package/dist/ui/assets/{memory-curation-seam-C0BliwwJ.js → memory-curation-seam-DFftwyHh.js} +1 -1
  74. package/dist/ui/assets/{memory-health-C3D8lYLJ.js → memory-health-DF6IEFmt.js} +1 -1
  75. package/dist/ui/assets/{memory-write-execute-DbjHzPlQ.js → memory-write-execute-C7SUGCPF.js} +1 -1
  76. package/dist/ui/assets/{mount-CbM_5jlW.js → mount-BfPgf0TT.js} +1 -1
  77. package/dist/ui/assets/{mount-Cc1ACftx.js → mount-BsWbgqHU.js} +3 -3
  78. package/dist/ui/assets/{new-session-Dhc5HhIU.js → new-session-n4ieWj9Q.js} +2 -2
  79. package/dist/ui/assets/node-builtins-CDetdLPH.js +1 -0
  80. package/dist/ui/assets/{oauth-bootstrap-qAiKs1B_.js → oauth-bootstrap-DEjPbx0S.js} +2 -2
  81. package/dist/ui/assets/{onboarding-orchestrator-hoO7C1AA.js → onboarding-orchestrator-DTq_WzOT.js} +1 -1
  82. package/dist/ui/assets/{openai-codex-COpScXj-.js → openai-codex-CRBPHYXu.js} +1 -1
  83. package/dist/ui/assets/{openai-codex-DG55IJPc.js → openai-codex-CZFJxrdp.js} +1 -1
  84. package/dist/ui/assets/{openrouter-oXd9rfD3.js → openrouter-Bp2hCSj0.js} +1 -1
  85. package/dist/ui/assets/{openrouter-free-CCSSamEo.js → openrouter-free-B1aHr6YX.js} +1 -1
  86. package/dist/ui/assets/{openrouter-free-CcVhLq57.js → openrouter-free-Ciud-jQF.js} +1 -1
  87. package/dist/ui/assets/{openrouter-oauth-2uZjw1ni.js → openrouter-oauth-BShl7mda.js} +1 -1
  88. package/dist/ui/assets/{openrouter-oauth-D79F7soa.js → openrouter-oauth-CBNfp9B7.js} +1 -1
  89. package/dist/ui/assets/{openrouter-CvejhujC.js → openrouter-xrK_Q7tb.js} +1 -1
  90. package/dist/ui/assets/{opfs-mount-DLFtoGv0.js → opfs-mount-DF1_TQm7.js} +1 -1
  91. package/dist/ui/assets/{panel-rpc-handlers-7ANN9krW.js → panel-rpc-handlers-DYotibPR.js} +2 -2
  92. package/dist/ui/assets/{panelize-shell-DvvHjgSE.js → panelize-shell-5hKkbwSl.js} +1 -1
  93. package/dist/ui/assets/{pi-edit-execution-B9ByKtUU.js → pi-edit-execution-CcLt8vSI.js} +1 -1
  94. package/dist/ui/assets/{provider-Dx5FZDvY.js → provider-BLshPMsZ.js} +2 -2
  95. package/dist/ui/assets/{provider-sZNLAM5_.js → provider-DqEfigmv.js} +1 -1
  96. package/dist/ui/assets/{provider-settings-geYZ3XeM.js → provider-settings-BuaTQYid.js} +1 -1
  97. package/dist/ui/assets/provider-store-access-BABW1Cfu.js +1 -0
  98. package/dist/ui/assets/provider-store-access-C2xFS3NU.js +1 -0
  99. package/dist/ui/assets/{providers-Cv9xIHXL.js → providers-B3cOXz1H.js} +1 -1
  100. package/dist/ui/assets/providers-CE4VqQs6.js +2 -0
  101. package/dist/ui/assets/{py-live-vfs-Uud7Qmjl.js → py-live-vfs-9-2YNjh0.js} +1 -1
  102. package/dist/ui/assets/{py-live-vfs-DeChUQwG.js → py-live-vfs-CUJmBBlI.js} +1 -1
  103. package/dist/ui/assets/{py-realm-worker-CpOMOUd5.js → py-realm-worker-DtGB9J_v.js} +1 -1
  104. package/dist/ui/assets/{pyodide-DFCa52VK.js → pyodide-D9Uqa092.js} +2 -2
  105. package/dist/ui/assets/{quick-llm-CpA-UQN0.js → quick-llm-D1wGZooG.js} +1 -1
  106. package/dist/ui/assets/realm-inprocess-Dcn5yLm3.js +33 -0
  107. package/dist/ui/assets/realm-unhandled-rejections-BU76F0PI.js +1 -0
  108. package/dist/ui/assets/realm-unhandled-rejections-BXxVemlU.js +1 -0
  109. package/dist/ui/assets/{recovery-screen-i_JWvRnt.js → recovery-screen-D6HBp0xj.js} +1 -1
  110. package/dist/ui/assets/{remote-terminal-view-g-DPTw6U.js → remote-terminal-view-BDO5t9M_.js} +2 -2
  111. package/dist/ui/assets/{require-guards-DyoCy2Tn.js → require-guards-e8NvgvH_.js} +2 -2
  112. package/dist/ui/assets/{restore-Yho5__FC.js → restore-CdH_ze1C.js} +1 -1
  113. package/dist/ui/assets/{run-BvmSPgsD.js → run-B4snw1GL.js} +2 -2
  114. package/dist/ui/assets/{run-Czj6x4Rv.js → run-C-NU4dPD.js} +1 -1
  115. package/dist/ui/assets/{run-OgGDVYh4.js → run-CK7bQLZ0.js} +3 -3
  116. package/dist/ui/assets/{run-Dc0GjGeK.js → run-C_6GKpBV.js} +1 -1
  117. package/dist/ui/assets/{run-Clez1C47.js → run-CkKb9UWF.js} +2 -2
  118. package/dist/ui/assets/{run-DRsWmRGT.js → run-D2pF2y1_.js} +1 -1
  119. package/dist/ui/assets/{run-CyJBimTl.js → run-DNvbqTbo.js} +1 -1
  120. package/dist/ui/assets/{run-BKoiZyLe.js → run-DsYsM6Yl.js} +1 -1
  121. package/dist/ui/assets/{run-DK9rNW7X.js → run-fHfrubKD.js} +1 -1
  122. package/dist/ui/assets/{run-bWHW0TzP.js → run-xrVX3llR.js} +1 -1
  123. package/dist/ui/assets/{screencapture-run-Dt7lEfIp.js → screencapture-run-jNQom_As.js} +1 -1
  124. package/dist/ui/assets/{session-command-memory-DwQY_-Jn.js → session-command-memory-CGqbKVAE.js} +2 -2
  125. package/dist/ui/assets/{session-jsonl-BPjOpnuv.js → session-jsonl-CbNA3lGB.js} +1 -1
  126. package/dist/ui/assets/{session-jsonl-D5OWzUb8.js → session-jsonl-CgKvYDUr.js} +1 -1
  127. package/dist/ui/assets/{session-search-index-CQCVYWik.js → session-search-index-CKHuYyZd.js} +1 -1
  128. package/dist/ui/assets/{setup-feature-flags-remote-Da98m8-c.js → setup-feature-flags-remote-DU_3gSCe.js} +1 -1
  129. package/dist/ui/assets/{setup-model-catalog-CpN89kS0.js → setup-model-catalog-CQmIQSJ6.js} +1 -1
  130. package/dist/ui/assets/shared-2XhBobrM.js +4 -0
  131. package/dist/ui/assets/{signed-fetch-B9AefGxo.js → signed-fetch-DEi8arT4.js} +1 -1
  132. package/dist/ui/assets/{silent-renew-backoff-D4BkLCku.js → silent-renew-backoff-UU1St8tN.js} +1 -1
  133. package/dist/ui/assets/slicc-version-D8Zbv4vp.js +1 -0
  134. package/dist/ui/assets/{snapshot-BpngInyf.js → snapshot-BPuldVwP.js} +1 -1
  135. package/dist/ui/assets/{snapshot-features-C1KRnKvW.js → snapshot-features-Ddz9jsBd.js} +1 -1
  136. package/dist/ui/assets/{soundscape-55hCbegl.js → soundscape-Uopjnq2I.js} +1 -1
  137. package/dist/ui/assets/{speak-DRjoNxOT.js → speak-D_PLnidz.js} +1 -1
  138. package/dist/ui/assets/{sprinkle-manager-Cj9OtFk7.js → sprinkle-manager-BpNh9Lri.js} +1 -1
  139. package/dist/ui/assets/{sprinkle-renderer-DvisyAbr.js → sprinkle-renderer-BljwWT0g.js} +1 -1
  140. package/dist/ui/assets/src-CUSndb9K.js +1 -0
  141. package/dist/ui/assets/{ssh-hwEw2JDy.js → ssh-DBPFvqmL.js} +1 -1
  142. package/dist/ui/assets/{state-xnCFNcHc.js → state-CHrSe9Ro.js} +1 -1
  143. package/dist/ui/assets/{store-CsgLyaBu.js → store-BikzV66S.js} +1 -1
  144. package/dist/ui/assets/{store-BZUZEii9.js → store-BvFCmAq8.js} +1 -1
  145. package/dist/ui/assets/{sudo-CpM0_7-f.js → sudo-rquT1VWH.js} +1 -1
  146. package/dist/ui/assets/{supervisor-CCtgWHNU.js → supervisor-MXcG8SU6.js} +1 -1
  147. package/dist/ui/assets/{sync-dialog-kfyeJrvC.js → sync-dialog-zmsfROKR.js} +1 -1
  148. package/dist/ui/assets/temperature-support-CIu8ekGh.js +1 -0
  149. package/dist/ui/assets/temperature-support-D3pN575q.js +1 -0
  150. package/dist/ui/assets/{transformers-env-D0Ft5AnW.js → transformers-env-DVU2J7Xd.js} +1 -1
  151. package/dist/ui/assets/tray-leader-5xt9j15D.js +1 -0
  152. package/dist/ui/assets/{tray-leave-runtime-D1kxfPYV.js → tray-leave-runtime-B5LmQl4b.js} +1 -1
  153. package/dist/ui/assets/tray-sidecar-pljn-63X.js +2 -0
  154. package/dist/ui/assets/{turn-journal-C3RmT-4t.js → turn-journal-I2u4GdDj.js} +1 -1
  155. package/dist/ui/assets/{upgrade-detection-CZsbpDf8.js → upgrade-detection-Ta4nIJJR.js} +1 -1
  156. package/dist/ui/assets/{upskill-lick-skip-B1aTWac3.js → upskill-lick-skip-IyN1i0IF.js} +1 -1
  157. package/dist/ui/assets/{voice-reply-Dc0ozuqt.js → voice-reply-aiuvZ8F3.js} +1 -1
  158. package/dist/ui/assets/{wc-attach-6OZlMIwW.js → wc-attach-C1CTfWQ-.js} +2 -2
  159. package/dist/ui/assets/{wc-browser-B2QFEwqe.js → wc-browser-RbezSPht.js} +1 -1
  160. package/dist/ui/assets/{wc-computers-CCdbZdxQ.js → wc-computers-D4IEEM5M.js} +1 -1
  161. package/dist/ui/assets/{wc-detached-CvESCw-O.js → wc-detached-CrVlYV_z.js} +1 -1
  162. package/dist/ui/assets/{wc-extension-D0foV_ib.js → wc-extension-BW5y8hdg.js} +2 -2
  163. package/dist/ui/assets/wc-follower-oauth-BArMqE7c.js +5 -0
  164. package/dist/ui/assets/wc-follower-xchSJ13T.js +17 -0
  165. package/dist/ui/assets/{wc-gelatiere-CJxyMbHo.js → wc-gelatiere-CxGkXDNo.js} +1 -1
  166. package/dist/ui/assets/{wc-live-BoLWLz9Z.js → wc-live-DdOUCb1z.js} +6 -6
  167. package/dist/ui/assets/{wc-nav-C3wn-3dH.js → wc-nav-C-cqoNl9.js} +2 -2
  168. package/dist/ui/assets/{wc-onboarding-DSGTg720.js → wc-onboarding-CId-wqvG.js} +2 -2
  169. package/dist/ui/assets/{wc-permissions-Dt6tAGYb.js → wc-permissions-lj9xrdU-.js} +2 -2
  170. package/dist/ui/assets/{wc-placeholder-tXAR_WLy.js → wc-placeholder-bs83QBxc.js} +3 -3
  171. package/dist/ui/assets/{wc-secret-request-D3oqwar-.js → wc-secret-request-BmVSG3Qe.js} +1 -1
  172. package/dist/ui/assets/{wc-settings-CA4t9KOD.js → wc-settings-CE5aZbkW.js} +3 -3
  173. package/dist/ui/assets/{wc-shell-kYp04Uca.js → wc-shell-DdSbkIp-.js} +3 -3
  174. package/dist/ui/assets/{wc-shortcut-config-t41Zisk5.js → wc-shortcut-config-C2d66GP8.js} +1 -1
  175. package/dist/ui/assets/{wc-sprinkles-Ce0z4QiY.js → wc-sprinkles-ak7XBDCk.js} +2 -2
  176. package/dist/ui/assets/{wc-transcript-export-zUoMikMo.js → wc-transcript-export-DYVbwupj.js} +2 -2
  177. package/dist/ui/assets/wc-tray-CjkC7SwM.js +5 -0
  178. package/dist/ui/assets/welcome-detection-BAQGL8Ld.js +1 -0
  179. package/dist/ui/assets/{whisper-session-Dv9ZtYsN.js → whisper-session-DBea3Pzc.js} +2 -2
  180. package/dist/ui/assets/{xai-grok-Bd2BL4cS.js → xai-grok-B-WV19uN.js} +1 -1
  181. package/dist/ui/assets/{xai-grok-BIYj0ZEJ.js → xai-grok-CAPZiieq.js} +1 -1
  182. package/dist/ui/index.html +5 -5
  183. package/dist/ui/packages/webapp/index.html +5 -5
  184. package/package.json +1 -1
  185. package/dist/ui/assets/__vite-browser-external-DH1K0mQP.js +0 -1
  186. package/dist/ui/assets/account-store-BMyZ1LC1.js +0 -1
  187. package/dist/ui/assets/account-store-ClzKIIMy.js +0 -2
  188. package/dist/ui/assets/bedrock-camp-BQ02i7Bk.js +0 -1
  189. package/dist/ui/assets/bedrock-camp-CMYc0nQP.js +0 -1
  190. package/dist/ui/assets/bedrock-camp-compat-99DjWBHV.js +0 -1
  191. package/dist/ui/assets/bedrock-camp-compat-BeCSBUrZ.js +0 -1
  192. package/dist/ui/assets/bedrock-camp-extra-models-B0WH9IRx.js +0 -1
  193. package/dist/ui/assets/bedrock-camp-extra-models-WTCIjj5a.js +0 -1
  194. package/dist/ui/assets/buffer-polyfill-BccMjOKj.js +0 -1
  195. package/dist/ui/assets/emscripten-vfs-hook-D0g146Sa.js +0 -1
  196. package/dist/ui/assets/live-vfs-fs-DXo5N-ez.js +0 -1
  197. package/dist/ui/assets/provider-store-access-PD8D6Ly5.js +0 -1
  198. package/dist/ui/assets/provider-store-access-tUmVoIgf.js +0 -1
  199. package/dist/ui/assets/providers-CsJ6PgRK.js +0 -2
  200. package/dist/ui/assets/realm-inprocess-BPfc1UTZ.js +0 -33
  201. package/dist/ui/assets/shared-DfMXB1pm.js +0 -4
  202. package/dist/ui/assets/slicc-version-D3PQZH1j.js +0 -1
  203. package/dist/ui/assets/temperature-support-Dd00cuZX.js +0 -1
  204. package/dist/ui/assets/temperature-support-PjwXIa-F.js +0 -1
  205. package/dist/ui/assets/tray-leader-gwAMllRq.js +0 -1
  206. package/dist/ui/assets/tray-sidecar-CF5Qu4Xu.js +0 -2
  207. package/dist/ui/assets/wc-follower-DRG_fFhc.js +0 -17
  208. package/dist/ui/assets/wc-follower-oauth-BNclaglp.js +0 -5
  209. package/dist/ui/assets/wc-tray-D6Q1hPos.js +0 -5
  210. package/dist/ui/assets/welcome-detection-CvTYmIMA.js +0 -1
@@ -1 +1 @@
1
- import{CHAT_SURFACE_ID as e}from"./wc-sprinkles-Ce0z4QiY.js";var t=`focus`,n={type:`leaf`,surfaceId:`chat`};function r(e,t={},n={}){return{zones:{top:null,left:null,middle:null,right:null,bottom:null,...e},rowFr:{top:1,center:1,bottom:1,...n},colFr:{left:1,middle:1,right:1,...t}}}var i={focus:{name:`focus`,tree:r({left:n},{left:3,middle:1})}};function a(e){return i[e]??null}function o(n,r){switch(r.kind){case`set`:n.applyLayout(r.tree);break;case`reset`:{let e=a(t);e&&n.applyLayout(e.tree);break}case`chat`:n.moveSurfaceToZone(e,r.zone);break;case`open`:n.placeSurface(r.zone,r.surfaceId);break;case`close`:n.removeSurface(r.surfaceId);break;case`move`:n.moveSurfaceToZone(r.surfaceId,r.zone);break;case`size`:n.setSurfaceSize(r.surfaceId,r.size)}}export{o as applyLayout};
1
+ import{CHAT_SURFACE_ID as e}from"./wc-sprinkles-ak7XBDCk.js";var t=`focus`,n={type:`leaf`,surfaceId:`chat`};function r(e,t={},n={}){return{zones:{top:null,left:null,middle:null,right:null,bottom:null,...e},rowFr:{top:1,center:1,bottom:1,...n},colFr:{left:1,middle:1,right:1,...t}}}var i={focus:{name:`focus`,tree:r({left:n},{left:3,middle:1})}};function a(e){return i[e]??null}function o(n,r){switch(r.kind){case`set`:n.applyLayout(r.tree);break;case`reset`:{let e=a(t);e&&n.applyLayout(e.tree);break}case`chat`:n.moveSurfaceToZone(e,r.zone);break;case`open`:n.placeSurface(r.zone,r.surfaceId);break;case`close`:n.removeSurface(r.surfaceId);break;case`move`:n.moveSurfaceToZone(r.surfaceId,r.zone);break;case`size`:n.setSurfaceSize(r.surfaceId,r.size)}}export{o as applyLayout};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./logger-LESFN7Hj.js";import{t}from"./slugify-BYJ6QVAt.js";import{t as n}from"./types-D8gIX-W-.js";import{t as r}from"./html-B_Hg2WOy.js";import{t as i}from"./global-db-DJXlpNui.js";const a=e(`mcp-apps`),o=`/workspace/.mcp/sprinkles`;async function s(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-DnLOvvvT.js`).then(e=>e.t);return await t.create({dbName:i})}function c(e){return t(e,{maxLen:64,fallback:`app`})}function l(e,t){let n=r(t.title??t.name),i=t.description?r(t.description):``,a=r(t.templateUri??`about:blank`),o=JSON.stringify(e),s=JSON.stringify(t.name);return`<div class="mcp-app" data-sprinkle-title="${n}" style="display:flex;flex-direction:column;height:100%;min-height:0;">
1
+ import{t as e}from"./logger-LESFN7Hj.js";import{t}from"./slugify-BYJ6QVAt.js";import{t as n}from"./types-D8gIX-W-.js";import{t as r}from"./html-B_Hg2WOy.js";import{t as i}from"./global-db-DJXlpNui.js";const a=e(`mcp-apps`),o=`/workspace/.mcp/sprinkles`;async function s(e){if(e)return e;let{VirtualFS:t}=await import(`./fs-D5UZBrBX.js`).then(e=>e.t);return await t.create({dbName:i})}function c(e){return t(e,{maxLen:64,fallback:`app`})}function l(e,t){let n=r(t.title??t.name),i=t.description?r(t.description):``,a=r(t.templateUri??`about:blank`),o=JSON.stringify(e),s=JSON.stringify(t.name);return`<div class="mcp-app" data-sprinkle-title="${n}" style="display:flex;flex-direction:column;height:100%;min-height:0;">
2
2
  <header class="mcp-app__header" style="padding:8px 12px;border-bottom:1px solid var(--s2-border-subtle,#3a3a3a);">
3
3
  <h2 style="font-size:14px;font-weight:600;margin:0;">${n}</h2>${i?`\n <p style="font-size:12px;margin:4px 0 0;color:var(--s2-content-secondary,#a0a0a0);">${i}</p>`:``}
4
4
  </header>
@@ -1,4 +1,4 @@
1
- import{c as e,o as t}from"./account-store-BMyZ1LC1.js";import{a as n}from"./diagnostics-DN_idNHx.js";import{t as r}from"./models-4WTk3EBD.js";import{a as i}from"./compat-uEPf6-XW.js";import{r as a,t as o}from"./transform-messages-Jn8bw4-u.js";function s(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function c(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}let l=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return l=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))};function u(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}const d=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};var f=class extends Error{},p=class e extends f{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new h({message:r,cause:d(n)});let a=n?.error;return t===400?new _(t,a,r,i):t===401?new v(t,a,r,i):t===403?new y(t,a,r,i):t===404?new b(t,a,r,i):t===409?new x(t,a,r,i):t===422?new ee(t,a,r,i):t===429?new te(t,a,r,i):t>=500?new ne(t,a,r,i):new e(t,a,r,i)}},m=class extends p{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},h=class extends p{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},g=class extends h{constructor({message:e}={}){super({message:e??`Request timed out.`})}},_=class extends p{},v=class extends p{},y=class extends p{},b=class extends p{},x=class extends p{},ee=class extends p{},te=class extends p{},ne=class extends p{},re=class extends f{constructor(){super(`Could not parse response content as the length limit was reached`)}},ie=class extends f{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},ae=class extends Error{constructor(e){super(e)}},oe=class extends p{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},se=class extends f{constructor(e,t,n){super(e),this.provider=t,this.cause=n}};const ce=/^[a-z][a-z0-9+.-]*:/i,le=e=>ce.test(e);let S=e=>(S=Array.isArray,S(e)),ue=S;function de(e){return typeof e==`object`?e??{}:{}}function fe(e){if(!e)return!0;for(let t in e)return!1;return!0}function pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const me=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new f(`${e} must be an integer`);if(t<0)throw new f(`${e} must be a positive integer`);return t},he=e=>{try{return JSON.parse(e)}catch{return}},ge=e=>new Promise(t=>setTimeout(t,e));function _e(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ve(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ye(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ve({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function be(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let Se;function w(e){let t;return(Se??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}let Ce;function we(e){let t;return(Ce??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var Te,T,E,D,O,Ee,De;const Oe=65536;var ke=class{constructor(){Te.add(this),T.set(this,void 0),E.set(this,void 0),D.set(this,void 0),O.set(this,void 0),Ee.set(this,void 0),s(this,T,new Uint8Array,`f`),s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),s(this,Ee,!1,`f`)}decode(e){if(e==null)return[];let t;if(t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?w(e):e,t.length===0||c(this,Ee,`f`)&&(s(this,Ee,!1,`f`),t[0]===10&&(t=t.subarray(1)),t.length===0))return[];c(this,Te,`m`,De).call(this,t);let n=[],r;for(;(r=Ae(c(this,T,`f`),c(this,O,`f`),c(this,D,`f`)))!=null;){let e=we(c(this,T,`f`).subarray(c(this,E,`f`),r.preceding));n.push(e),s(this,E,r.index,`f`),r.carriage&&(c(this,E,`f`)<c(this,D,`f`)&&c(this,T,`f`)[c(this,E,`f`)]===10?s(this,E,c(this,E,`f`)+1,`f`):c(this,E,`f`)===c(this,D,`f`)&&s(this,Ee,!0,`f`)),s(this,O,c(this,E,`f`),`f`)}if(s(this,O,c(this,D,`f`),`f`),c(this,E,`f`)===c(this,D,`f`))s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),c(this,T,`f`).length>Oe&&s(this,T,new Uint8Array,`f`);else if(n.length>0&&c(this,T,`f`).length>Oe){let e=c(this,D,`f`)-c(this,E,`f`);if(e<=Oe||c(this,T,`f`).length>e*4){let t=e<=Oe?Math.min(Math.max(e*2,256),Oe):e*2,n=new Uint8Array(t);n.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,n,`f`),s(this,E,0,`f`),s(this,D,e,`f`),s(this,O,e,`f`)}}return n}flush(){return s(this,Ee,!1,`f`),c(this,E,`f`)===c(this,D,`f`)?[]:this.decode(`
1
+ import{c as e,o as t}from"./account-store-irTFXEHq.js";import{a as n}from"./diagnostics-DN_idNHx.js";import{t as r}from"./models-4WTk3EBD.js";import{a as i}from"./compat-uEPf6-XW.js";import{r as a,t as o}from"./transform-messages-Jn8bw4-u.js";function s(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function c(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}let l=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return l=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))};function u(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}const d=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)};var f=class extends Error{},p=class e extends f{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new h({message:r,cause:d(n)});let a=n?.error;return t===400?new _(t,a,r,i):t===401?new v(t,a,r,i):t===403?new y(t,a,r,i):t===404?new b(t,a,r,i):t===409?new x(t,a,r,i):t===422?new ee(t,a,r,i):t===429?new te(t,a,r,i):t>=500?new ne(t,a,r,i):new e(t,a,r,i)}},m=class extends p{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},h=class extends p{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},g=class extends h{constructor({message:e}={}){super({message:e??`Request timed out.`})}},_=class extends p{},v=class extends p{},y=class extends p{},b=class extends p{},x=class extends p{},ee=class extends p{},te=class extends p{},ne=class extends p{},re=class extends f{constructor(){super(`Could not parse response content as the length limit was reached`)}},ie=class extends f{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},ae=class extends Error{constructor(e){super(e)}},oe=class extends p{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},se=class extends f{constructor(e,t,n){super(e),this.provider=t,this.cause=n}};const ce=/^[a-z][a-z0-9+.-]*:/i,le=e=>ce.test(e);let S=e=>(S=Array.isArray,S(e)),ue=S;function de(e){return typeof e==`object`?e??{}:{}}function fe(e){if(!e)return!0;for(let t in e)return!1;return!0}function pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const me=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new f(`${e} must be an integer`);if(t<0)throw new f(`${e} must be a positive integer`);return t},he=e=>{try{return JSON.parse(e)}catch{return}},ge=e=>new Promise(t=>setTimeout(t,e));function _e(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ve(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ye(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ve({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function be(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}let Se;function w(e){let t;return(Se??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}let Ce;function we(e){let t;return(Ce??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var Te,T,E,D,O,Ee,De;const Oe=65536;var ke=class{constructor(){Te.add(this),T.set(this,void 0),E.set(this,void 0),D.set(this,void 0),O.set(this,void 0),Ee.set(this,void 0),s(this,T,new Uint8Array,`f`),s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),s(this,Ee,!1,`f`)}decode(e){if(e==null)return[];let t;if(t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?w(e):e,t.length===0||c(this,Ee,`f`)&&(s(this,Ee,!1,`f`),t[0]===10&&(t=t.subarray(1)),t.length===0))return[];c(this,Te,`m`,De).call(this,t);let n=[],r;for(;(r=Ae(c(this,T,`f`),c(this,O,`f`),c(this,D,`f`)))!=null;){let e=we(c(this,T,`f`).subarray(c(this,E,`f`),r.preceding));n.push(e),s(this,E,r.index,`f`),r.carriage&&(c(this,E,`f`)<c(this,D,`f`)&&c(this,T,`f`)[c(this,E,`f`)]===10?s(this,E,c(this,E,`f`)+1,`f`):c(this,E,`f`)===c(this,D,`f`)&&s(this,Ee,!0,`f`)),s(this,O,c(this,E,`f`),`f`)}if(s(this,O,c(this,D,`f`),`f`),c(this,E,`f`)===c(this,D,`f`))s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),c(this,T,`f`).length>Oe&&s(this,T,new Uint8Array,`f`);else if(n.length>0&&c(this,T,`f`).length>Oe){let e=c(this,D,`f`)-c(this,E,`f`);if(e<=Oe||c(this,T,`f`).length>e*4){let t=e<=Oe?Math.min(Math.max(e*2,256),Oe):e*2,n=new Uint8Array(t);n.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,n,`f`),s(this,E,0,`f`),s(this,D,e,`f`),s(this,O,e,`f`)}}return n}flush(){return s(this,Ee,!1,`f`),c(this,E,`f`)===c(this,D,`f`)?[]:this.decode(`
2
2
  `)}};T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakMap,Ee=new WeakMap,Te=new WeakSet,De=function(e){if(c(this,D,`f`)+e.length>c(this,T,`f`).length){let t=c(this,D,`f`)-c(this,E,`f`);if(c(this,E,`f`)>=c(this,T,`f`).length/2&&t+e.length<=c(this,T,`f`).length)c(this,T,`f`).copyWithin(0,c(this,E,`f`),c(this,D,`f`));else{let n=Math.max(c(this,T,`f`).length*2,t+e.length,256),r=new Uint8Array(n);r.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,r,`f`)}s(this,O,c(this,O,`f`)-c(this,E,`f`),`f`),s(this,D,t,`f`),s(this,E,0,`f`)}c(this,T,`f`).set(e,c(this,D,`f`)),s(this,D,c(this,D,`f`)+e.length,`f`)},ke.NEWLINE_CHARS=new Set([`
3
3
  `,`\r`]),ke.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ae(e,t,n){for(let r=t;r<n;r++){if(e[r]===10)return{preceding:r,index:r+1,carriage:!1};if(e[r]===13)return{preceding:r,index:r+1,carriage:!0}}return null}function je(e){for(let t=0;t<e.length-1;t++){let n=Me(e,t);if(n>0){let r=t+n,i=Me(e,r);if(i>0)return r+i}}return-1}function Me(e,t){return e[t]===10?1:e[t]===13?e[t+1]===10?2:1:0}const Ne={off:0,error:200,warn:300,info:400,debug:500},Pe=(e,t,n)=>{if(e){if(pe(Ne,e))return e;k(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ne))}`)}};function Fe(){}function Ie(e,t,n){return!t||Ne[e]>Ne[n]?Fe:t[e].bind(t)}const Le={error:Fe,warn:Fe,info:Fe,debug:Fe};let Re=new WeakMap;function k(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return Le;let r=Re.get(t);if(r&&r[0]===n)return r[1];let i={error:Ie(`error`,t,n),warn:Ie(`warn`,t,n),info:Ie(`info`,t,n),debug:Ie(`debug`,t,n)};return Re.set(t,[n,i]),i}const ze=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`authorization`||e.toLowerCase()===`api-key`||e.toLowerCase()===`x-api-key`||e.toLowerCase()===`x-amz-security-token`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);var Be,Ve=class e{constructor(e,t,n){Be.set(this,void 0),this.iterator=e,this.controller=t,s(this,Be,n,`f`)}static fromSSEResponse(t,n,r,i){let a=!1,o=r?k(r):console;async function*s(){if(a)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let e=!1,r=!1;try{for await(let e of He(t,n)){if(e.data.startsWith(`[DONE]`)){r=!0;break}if(e.event===null||!e.event.startsWith(`thread.`)){let n;try{n=JSON.parse(e.data)}catch(t){throw o.error(`Could not parse message into JSON:`,e.data),o.error(`From chunk:`,e.raw),t}if(n&&n.error)throw new p(void 0,n.error,void 0,t.headers);yield i?{event:e.event,data:n}:n}else{let t;try{t=JSON.parse(e.data)}catch(t){throw console.error(`Could not parse message into JSON:`,e.data),console.error(`From chunk:`,e.raw),t}if(e.event===`error`)throw new p(void 0,t.error,t.message,void 0);yield{event:e.event,data:t}}}e=!0}catch(e){if(r||u(e)||n.signal.aborted&&e===n.signal.reason)return;throw e}finally{e||n.abort()}}return new e(s,n,r)}static fromReadableStream(t,n,r){let i=!1;async function*a(){let e=new ke,r=t.getReader(),i=!1,a,o=()=>{a??=r.cancel(),a.catch(()=>void 0)};n.signal.addEventListener(`abort`,o,{once:!0});try{if(n.signal.aborted){o();return}for(;;){let{value:t,done:a}=await r.read();if(a){i=!0;break}if(n.signal.aborted)return;for(let r of e.decode(t)){if(n.signal.aborted)return;yield r}}if(n.signal.aborted)return;for(let t of e.flush()){if(n.signal.aborted)return;yield t}}finally{n.signal.removeEventListener(`abort`,o),i||o(),r.releaseLock()}}async function*o(){if(i)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let e=!1;try{for await(let t of a())e||t&&(yield JSON.parse(t));e=!0}catch(e){if(n.signal.aborted||u(e))return;throw e}finally{e||n.abort()}}return new e(o,n,r)}[(Be=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=e=>({next:()=>{if(e.length===0){let e=r.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>i(t),this.controller,c(this,Be,`f`)),new e(()=>i(n),this.controller,c(this,Be,`f`))]}toReadableStream(){let e;return ve({start:async()=>{e=this[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let i=w(JSON.stringify(n)+`
4
4
  `);t.enqueue(i)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}};async function*He(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new f(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new f(`Attempted to iterate over a response with no body`);let n=new We,r=new ke,i=be(e.body);for await(let e of Ue(i))for(let t of r.decode(e)){let e=n.decode(t);e&&(yield e)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*Ue(e){let t=new Uint8Array,n=0,r=0,i=0;for await(let a of e){if(a==null)continue;let e;if(e=a instanceof ArrayBuffer?new Uint8Array(a):typeof a==`string`?w(a):a,r+e.length>t.length){let a=r-n;if(n>=t.length/2&&a+e.length<=t.length)t.copyWithin(0,n,r);else{let i=new Uint8Array(Math.max(t.length*2,a+e.length));i.set(t.subarray(n,r)),t=i}i-=n,n=0,r=a}t.set(e,r),r+=e.length;let o;for(;(o=je(t.subarray(i,r)))!==-1;)o+=i,yield t.slice(n,o),n=o,i=n;i=Math.max(n,r-3)}r>n&&(yield t.slice(n,r))}var We=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.slice(0,-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
@@ -1,4 +1,4 @@
1
- import{a as e}from"./diagnostics-DN_idNHx.js";import{t}from"./models-BSkXF4T6.js";import{a as n}from"./compat-qQM4gjF_.js";import{S as r,v as i}from"./account-store-ClzKIIMy.js";import{r as a,t as o}from"./transform-messages-BsQjTIEJ.js";function s(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function c(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var l=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return l=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))};function u(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var d=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},f=class extends Error{},p=class e extends f{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new h({message:r,cause:d(n)});let a=n?.error;return t===400?new _(t,a,r,i):t===401?new v(t,a,r,i):t===403?new y(t,a,r,i):t===404?new b(t,a,r,i):t===409?new x(t,a,r,i):t===422?new ee(t,a,r,i):t===429?new te(t,a,r,i):t>=500?new ne(t,a,r,i):new e(t,a,r,i)}},m=class extends p{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},h=class extends p{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},g=class extends h{constructor({message:e}={}){super({message:e??`Request timed out.`})}},_=class extends p{},v=class extends p{},y=class extends p{},b=class extends p{},x=class extends p{},ee=class extends p{},te=class extends p{},ne=class extends p{},re=class extends f{constructor(){super(`Could not parse response content as the length limit was reached`)}},ie=class extends f{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},ae=class extends Error{constructor(e){super(e)}},oe=class extends p{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},se=class extends f{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},ce=/^[a-z][a-z0-9+.-]*:/i,le=e=>ce.test(e),S=e=>(S=Array.isArray,S(e)),ue=S;function de(e){return typeof e==`object`?e??{}:{}}function fe(e){if(!e)return!0;for(let t in e)return!1;return!0}function pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var me=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new f(`${e} must be an integer`);if(t<0)throw new f(`${e} must be a positive integer`);return t},he=e=>{try{return JSON.parse(e)}catch{return}},ge=e=>new Promise(t=>setTimeout(t,e));function _e(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ve(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ye(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ve({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function be(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Se;function w(e){let t;return(Se??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var Ce;function we(e){let t;return(Ce??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var Te,T,E,D,O,Ee,De,Oe=65536,ke=class{constructor(){Te.add(this),T.set(this,void 0),E.set(this,void 0),D.set(this,void 0),O.set(this,void 0),Ee.set(this,void 0),s(this,T,new Uint8Array,`f`),s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),s(this,Ee,!1,`f`)}decode(e){if(e==null)return[];let t;if(t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?w(e):e,t.length===0||c(this,Ee,`f`)&&(s(this,Ee,!1,`f`),t[0]===10&&(t=t.subarray(1)),t.length===0))return[];c(this,Te,`m`,De).call(this,t);let n=[],r;for(;(r=Ae(c(this,T,`f`),c(this,O,`f`),c(this,D,`f`)))!=null;){let e=we(c(this,T,`f`).subarray(c(this,E,`f`),r.preceding));n.push(e),s(this,E,r.index,`f`),r.carriage&&(c(this,E,`f`)<c(this,D,`f`)&&c(this,T,`f`)[c(this,E,`f`)]===10?s(this,E,c(this,E,`f`)+1,`f`):c(this,E,`f`)===c(this,D,`f`)&&s(this,Ee,!0,`f`)),s(this,O,c(this,E,`f`),`f`)}if(s(this,O,c(this,D,`f`),`f`),c(this,E,`f`)===c(this,D,`f`))s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),c(this,T,`f`).length>Oe&&s(this,T,new Uint8Array,`f`);else if(n.length>0&&c(this,T,`f`).length>Oe){let e=c(this,D,`f`)-c(this,E,`f`);if(e<=Oe||c(this,T,`f`).length>e*4){let t=e<=Oe?Math.min(Math.max(e*2,256),Oe):e*2,n=new Uint8Array(t);n.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,n,`f`),s(this,E,0,`f`),s(this,D,e,`f`),s(this,O,e,`f`)}}return n}flush(){return s(this,Ee,!1,`f`),c(this,E,`f`)===c(this,D,`f`)?[]:this.decode(`
1
+ import{a as e}from"./diagnostics-DN_idNHx.js";import{t}from"./models-BSkXF4T6.js";import{a as n}from"./compat-qQM4gjF_.js";import{S as r,v as i}from"./account-store-Bevys7WL.js";import{r as a,t as o}from"./transform-messages-BsQjTIEJ.js";function s(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function c(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var l=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return l=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^n()&15>>e/4).toString(16))};function u(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var d=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},f=class extends Error{},p=class e extends f{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,i){if(!t||!i)return new h({message:r,cause:d(n)});let a=n?.error;return t===400?new _(t,a,r,i):t===401?new v(t,a,r,i):t===403?new y(t,a,r,i):t===404?new b(t,a,r,i):t===409?new x(t,a,r,i):t===422?new ee(t,a,r,i):t===429?new te(t,a,r,i):t>=500?new ne(t,a,r,i):new e(t,a,r,i)}},m=class extends p{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},h=class extends p{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},g=class extends h{constructor({message:e}={}){super({message:e??`Request timed out.`})}},_=class extends p{},v=class extends p{},y=class extends p{},b=class extends p{},x=class extends p{},ee=class extends p{},te=class extends p{},ne=class extends p{},re=class extends f{constructor(){super(`Could not parse response content as the length limit was reached`)}},ie=class extends f{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},ae=class extends Error{constructor(e){super(e)}},oe=class extends p{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},se=class extends f{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},ce=/^[a-z][a-z0-9+.-]*:/i,le=e=>ce.test(e),S=e=>(S=Array.isArray,S(e)),ue=S;function de(e){return typeof e==`object`?e??{}:{}}function fe(e){if(!e)return!0;for(let t in e)return!1;return!0}function pe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function C(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var me=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new f(`${e} must be an integer`);if(t<0)throw new f(`${e} must be a positive integer`);return t},he=e=>{try{return JSON.parse(e)}catch{return}},ge=e=>new Promise(t=>setTimeout(t,e));function _e(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function ve(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function ye(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return ve({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function be(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xe(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Se;function w(e){let t;return(Se??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var Ce;function we(e){let t;return(Ce??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var Te,T,E,D,O,Ee,De,Oe=65536,ke=class{constructor(){Te.add(this),T.set(this,void 0),E.set(this,void 0),D.set(this,void 0),O.set(this,void 0),Ee.set(this,void 0),s(this,T,new Uint8Array,`f`),s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),s(this,Ee,!1,`f`)}decode(e){if(e==null)return[];let t;if(t=e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`string`?w(e):e,t.length===0||c(this,Ee,`f`)&&(s(this,Ee,!1,`f`),t[0]===10&&(t=t.subarray(1)),t.length===0))return[];c(this,Te,`m`,De).call(this,t);let n=[],r;for(;(r=Ae(c(this,T,`f`),c(this,O,`f`),c(this,D,`f`)))!=null;){let e=we(c(this,T,`f`).subarray(c(this,E,`f`),r.preceding));n.push(e),s(this,E,r.index,`f`),r.carriage&&(c(this,E,`f`)<c(this,D,`f`)&&c(this,T,`f`)[c(this,E,`f`)]===10?s(this,E,c(this,E,`f`)+1,`f`):c(this,E,`f`)===c(this,D,`f`)&&s(this,Ee,!0,`f`)),s(this,O,c(this,E,`f`),`f`)}if(s(this,O,c(this,D,`f`),`f`),c(this,E,`f`)===c(this,D,`f`))s(this,E,0,`f`),s(this,D,0,`f`),s(this,O,0,`f`),c(this,T,`f`).length>Oe&&s(this,T,new Uint8Array,`f`);else if(n.length>0&&c(this,T,`f`).length>Oe){let e=c(this,D,`f`)-c(this,E,`f`);if(e<=Oe||c(this,T,`f`).length>e*4){let t=e<=Oe?Math.min(Math.max(e*2,256),Oe):e*2,n=new Uint8Array(t);n.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,n,`f`),s(this,E,0,`f`),s(this,D,e,`f`),s(this,O,e,`f`)}}return n}flush(){return s(this,Ee,!1,`f`),c(this,E,`f`)===c(this,D,`f`)?[]:this.decode(`
2
2
  `)}};T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakMap,Ee=new WeakMap,Te=new WeakSet,De=function(e){if(c(this,D,`f`)+e.length>c(this,T,`f`).length){let t=c(this,D,`f`)-c(this,E,`f`);if(c(this,E,`f`)>=c(this,T,`f`).length/2&&t+e.length<=c(this,T,`f`).length)c(this,T,`f`).copyWithin(0,c(this,E,`f`),c(this,D,`f`));else{let n=Math.max(c(this,T,`f`).length*2,t+e.length,256),r=new Uint8Array(n);r.set(c(this,T,`f`).subarray(c(this,E,`f`),c(this,D,`f`))),s(this,T,r,`f`)}s(this,O,c(this,O,`f`)-c(this,E,`f`),`f`),s(this,D,t,`f`),s(this,E,0,`f`)}c(this,T,`f`).set(e,c(this,D,`f`)),s(this,D,c(this,D,`f`)+e.length,`f`)},ke.NEWLINE_CHARS=new Set([`
3
3
  `,`\r`]),ke.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ae(e,t,n){for(let r=t;r<n;r++){if(e[r]===10)return{preceding:r,index:r+1,carriage:!1};if(e[r]===13)return{preceding:r,index:r+1,carriage:!0}}return null}function je(e){for(let t=0;t<e.length-1;t++){let n=Me(e,t);if(n>0){let r=t+n,i=Me(e,r);if(i>0)return r+i}}return-1}function Me(e,t){return e[t]===10?1:e[t]===13?e[t+1]===10?2:1:0}var Ne={off:0,error:200,warn:300,info:400,debug:500},Pe=(e,t,n)=>{if(e){if(pe(Ne,e))return e;k(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ne))}`)}};function Fe(){}function Ie(e,t,n){return!t||Ne[e]>Ne[n]?Fe:t[e].bind(t)}var Le={error:Fe,warn:Fe,info:Fe,debug:Fe},Re=new WeakMap;function k(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return Le;let r=Re.get(t);if(r&&r[0]===n)return r[1];let i={error:Ie(`error`,t,n),warn:Ie(`warn`,t,n),info:Ie(`info`,t,n),debug:Ie(`debug`,t,n)};return Re.set(t,[n,i]),i}var ze=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`authorization`||e.toLowerCase()===`api-key`||e.toLowerCase()===`x-api-key`||e.toLowerCase()===`x-amz-security-token`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),Be,Ve=class e{constructor(e,t,n){Be.set(this,void 0),this.iterator=e,this.controller=t,s(this,Be,n,`f`)}static fromSSEResponse(t,n,r,i){let a=!1,o=r?k(r):console;async function*s(){if(a)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let e=!1,r=!1;try{for await(let e of He(t,n)){if(e.data.startsWith(`[DONE]`)){r=!0;break}if(e.event===null||!e.event.startsWith(`thread.`)){let n;try{n=JSON.parse(e.data)}catch(t){throw o.error(`Could not parse message into JSON:`,e.data),o.error(`From chunk:`,e.raw),t}if(n&&n.error)throw new p(void 0,n.error,void 0,t.headers);yield i?{event:e.event,data:n}:n}else{let t;try{t=JSON.parse(e.data)}catch(t){throw console.error(`Could not parse message into JSON:`,e.data),console.error(`From chunk:`,e.raw),t}if(e.event===`error`)throw new p(void 0,t.error,t.message,void 0);yield{event:e.event,data:t}}}e=!0}catch(e){if(r||u(e)||n.signal.aborted&&e===n.signal.reason)return;throw e}finally{e||n.abort()}}return new e(s,n,r)}static fromReadableStream(t,n,r){let i=!1;async function*a(){let e=new ke,r=t.getReader(),i=!1,a,o=()=>{a??=r.cancel(),a.catch(()=>void 0)};n.signal.addEventListener(`abort`,o,{once:!0});try{if(n.signal.aborted){o();return}for(;;){let{value:t,done:a}=await r.read();if(a){i=!0;break}if(n.signal.aborted)return;for(let r of e.decode(t)){if(n.signal.aborted)return;yield r}}if(n.signal.aborted)return;for(let t of e.flush()){if(n.signal.aborted)return;yield t}}finally{n.signal.removeEventListener(`abort`,o),i||o(),r.releaseLock()}}async function*o(){if(i)throw new f("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let e=!1;try{for await(let t of a())e||t&&(yield JSON.parse(t));e=!0}catch(e){if(n.signal.aborted||u(e))return;throw e}finally{e||n.abort()}}return new e(o,n,r)}[(Be=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=e=>({next:()=>{if(e.length===0){let e=r.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>i(t),this.controller,c(this,Be,`f`)),new e(()=>i(n),this.controller,c(this,Be,`f`))]}toReadableStream(){let e;return ve({start:async()=>{e=this[Symbol.asyncIterator]()},async pull(t){try{let{value:n,done:r}=await e.next();if(r)return t.close();let i=w(JSON.stringify(n)+`
4
4
  `);t.enqueue(i)}catch(e){t.error(e)}},async cancel(){await e.return?.()}})}};async function*He(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new f(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new f(`Attempted to iterate over a response with no body`);let n=new Ge,r=new ke,i=be(e.body);for await(let e of We(i))for(let t of r.decode(e)){let e=n.decode(t);e&&(yield e)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}var Ue=3;async function*We(e){let t=new Uint8Array,n=0,r=0,i=0;for await(let a of e){if(a==null)continue;let e;if(e=a instanceof ArrayBuffer?new Uint8Array(a):typeof a==`string`?w(a):a,r+e.length>t.length){let a=r-n;if(n>=t.length/2&&a+e.length<=t.length)t.copyWithin(0,n,r);else{let i=new Uint8Array(Math.max(t.length*2,a+e.length));i.set(t.subarray(n,r)),t=i}i-=n,n=0,r=a}t.set(e,r),r+=e.length;let o;for(;(o=je(t.subarray(i,r)))!==-1;)o+=i,yield t.slice(n,o),n=o,i=n;i=Math.max(n,r-Ue)}r>n&&(yield t.slice(n,r))}var Ge=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.slice(0,-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
@@ -1 +1 @@
1
- import{s as e,t}from"./api-endpoint-DuEQRZ4g.js";import{t as n}from"./types-D8gIX-W-.js";import{n as r}from"./fs-D1Dp_Ep1.js";import{t as i}from"./remote-cache-3KNT1gsp.js";function a(e){if(!Number.isFinite(e))return{run:e=>e(),get active(){return 0}};let t=Math.max(1,Math.floor(e)),n=[],r=0,i=()=>{let e=n.shift();if(e){e();return}--r};return{async run(e){r>=t?await new Promise(e=>n.push(e)):r+=1;try{return await e()}finally{i()}},get active(){return r}}}var o=104857600,s=new Set([`list`,`stat`,`mkdir`,`rename`,`remove`]),c=`/api/hostfs`,l=new Set([`ENOENT`,`EEXIST`,`ENOTDIR`,`EISDIR`,`ENOTEMPTY`,`EINVAL`,`EACCES`,`ELOOP`,`EBUSY`,`EFBIG`,`EBADF`,`EIO`]),u=new Set([`list`,`stat`,`read`,`mkdir`]),d=3,f=25,p=24,m=3e4,h=4194304,g=`no-store`;function _(e,t){return`hostfs:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}var v=e=>e.json(),y=async e=>({partial:e.status===206,body:await e.arrayBuffer()}),b=async e=>{await e.arrayBuffer()},x=e=>e>0?new Promise(t=>setTimeout(t,e)):Promise.resolve();function S(e,t,r,i,a){let o=r instanceof Error?r.message:String(r),s=a?` after ${i} attempt${i===1?``:`s`}`:` (not retried: non-idempotent op)`;return new n(`EIO`,`hostfs ${e} failed${s}: transient bridge error: ${o}`,t)}function C(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function w(t){let n={},i=C(t.ctime);i!==void 0&&(n.ctime=i);let a=C(t.ino);a!==void 0&&(n.ino=a);let o=C(t.dev);o!==void 0&&Number.isSafeInteger(o)&&o>=0&&(n.dev=o,n.identity=r(`hostfs:${e(c)}`,a,o));let s=C(t.uid);s!==void 0&&(n.uid=s);let l=C(t.gid);l!==void 0&&(n.gid=l);let u=C(t.mode);return u!==void 0&&(n.mode=u),n}var T=class{kind=`hostfs`;listingStatsMatchStat=!0;source;mountId;targetPath;hostPath;fetchImpl;limiter;maxAttempts;retryDelayMs;cache;maxCachedBodyBytes;cacheGeneration=0;closed=!1;stableEndpoint=!0;constructor(e){this.targetPath=e.targetPath,this.hostPath=e.hostPath,this.source=`hostfs://${e.hostPath}`,this.mountId=e.mountId??_(e.targetPath,e.hostPath),this.fetchImpl=e.fetchImpl??fetch,this.limiter=a(e.maxInflight??p),this.maxAttempts=Math.max(1,e.maxAttempts??d),this.retryDelayMs=e.retryDelayMs??f,this.maxCachedBodyBytes=Math.max(0,e.maxCachedBodyBytes??h),this.cache=e.cache??new i({mountId:this.mountId,ttlMs:e.cacheTtlMs??m})}assertOpen(e){if(this.closed)throw new n(`EBADF`,`mount closed`,e)}bodyKey(e){return e.replace(/^\/+/,``)}async invalidateCachePrefixes(e){this.cacheGeneration+=1,await this.cache.invalidatePrefixes(e)}async cacheBodyIfCurrent(e,t,n,r){e!==this.cacheGeneration||n.byteLength>this.maxCachedBodyBytes||(await this.cache.putBody(t,n,r),e!==this.cacheGeneration&&await this.cache.invalidateBody(t))}async applyHostInvalidation(e){if(e.length===0){await this.invalidateCachePrefixes([]);return}let t=e.map(e=>e.replace(/^\/+/,``));if(t.some(e=>e.length===0||e===`.`)){await this.invalidateCachePrefixes([]);return}await this.invalidateCachePrefixes(t)}getCache(){return this.cache}url(t,n,r){let i=new URLSearchParams({mount:this.targetPath,path:n.replace(/^\/+/,``)});for(let[e,t]of Object.entries(r??{}))i.set(e,t);return e(`/api/hostfs/${t}?${i.toString()}`)}buildRequest(n,r,i){let a=t(i?.headers);if(this.stableEndpoint&&s.has(n))return{url:e(c),init:{method:`POST`,headers:{...a,"Content-Type":`application/json`},body:JSON.stringify({op:n,mount:this.targetPath,path:r.replace(/^\/+/,``),...i?.extra??{}})}};let{extra:o,...l}=i??{};return{url:this.url(n,r,i?.extra),init:{...l,headers:a}}}async request(e,t,n,r){return this.assertOpen(t),this.limiter.run(()=>this.attemptRequest(e,t,n,r))}async attemptRequest(e,t,r,i){let a=u.has(e)?this.maxAttempts:1,o=0,s;for(;o<a;){o+=1;try{return await this.routeAndConsume(e,t,r,i)}catch(e){if(e instanceof n)throw e;if(s=e,this.closed)break;o<a&&await x(this.retryDelayMs*o)}}throw S(e,t,s,o,a>1)}async routeAndConsume(e,t,n,r){let i=this.stableEndpoint&&s.has(e),a=this.buildRequest(e,t,r),o=await this.fetchImpl(a.url,a.init);if(o.ok||o.status===304)return await n(o);let{error:c,rawCode:l}=await this.errorFromResponse(e,t,o);if(i&&l===null&&(o.status===404||o.status===405))return this.stableEndpoint=!1,await this.routeAndConsume(e,t,n,r);throw c}async errorFromResponse(e,t,r){let i=`EIO`,a=null,o=`hostfs ${e} failed with HTTP ${r.status}`;try{let e=await r.json();typeof e.code==`string`&&(a=e.code,l.has(e.code)&&(i=e.code)),typeof e.message==`string`&&(o=e.message)}catch{}return{error:new n(i,o,t),rawCode:a}}async readDir(e){let t=await this.request(`list`,e,v);if(!Array.isArray(t.entries))return[];let n=[];for(let e of t.entries){let t=e;typeof t.name!=`string`||t.kind!==`file`&&t.kind!==`directory`||n.push({name:t.name,kind:t.kind,...typeof t.size==`number`?{size:t.size}:{},...typeof t.lastModified==`number`?{lastModified:t.lastModified}:{},...w(t)})}return n}async readFile(e){this.assertOpen(e);let t=this.cacheGeneration,r=this.bodyKey(e),i=await this.cache.getBody(r);if(i&&!this.cache.isStale(i.cachedAt))return i.body;let a={};i?.etag&&(a[`If-None-Match`]=i.etag);let s=await this.request(`read`,e,async e=>e.status===304?{kind:`not-modified`}:{kind:`body`,bytes:new Uint8Array(await e.arrayBuffer()),etag:e.headers.get(`etag`)??``},{cache:g,headers:a});if(s.kind===`not-modified`){if(!i)throw new n(`EIO`,`hostfs read got 304 without a cached body`,e);return await this.cacheBodyIfCurrent(t,r,i.body,i.etag),i.body}if(s.bytes.byteLength>o)throw new n(`EFBIG`,`file exceeds the hostfs body cap`,e);return await this.cacheBodyIfCurrent(t,r,s.bytes,s.etag),s.bytes}async readFileRange(e,t,r){if(!Number.isInteger(t)||!Number.isInteger(r)||t<0||r<t)throw new n(`EINVAL`,`invalid byte range ${t}-${r}`,e);if(r===t)return new Uint8Array;if(r-t>o)throw new n(`EFBIG`,`byte range exceeds the hostfs body cap`,e);let{partial:i,body:a}=await this.request(`read`,e,y,{cache:g,headers:{Range:`bytes=${t}-${r-1}`}});return i?new Uint8Array(a):new Uint8Array(a).slice(t,r)}async writeFile(e,t){if(t.byteLength>o)throw new n(`EFBIG`,`body exceeds the hostfs body cap`,e);await this.request(`write`,e,b,{method:`PUT`,headers:{"Content-Type":`application/octet-stream`},body:new Uint8Array(t)});let r=this.bodyKey(e),i=++this.cacheGeneration;t.byteLength<=this.maxCachedBodyBytes?await this.cacheBodyIfCurrent(i,r,new Uint8Array(t),``):await this.cache.invalidateBody(r)}async stat(e){let t=await this.request(`stat`,e,v);return{kind:t.kind===`directory`?`directory`:`file`,size:typeof t.size==`number`?t.size:0,mtime:typeof t.mtime==`number`?t.mtime:0,...w(t)}}async mkdir(e){await this.request(`mkdir`,e,b,{method:`POST`})}async rename(e,t){let n=await this.request(`rename`,e,v,{method:`POST`,extra:{to:t.replace(/^\/+/,``)}}),r=this.bodyKey(e),i=this.bodyKey(t);return await this.invalidateCachePrefixes([r,i]),n.noop===!0?{noop:!0}:{}}async remove(e,t){await this.request(`remove`,e,b,{method:`DELETE`,extra:t?.recursive?{recursive:`1`}:void 0});let n=this.bodyKey(e);t?.recursive?await this.invalidateCachePrefixes([n]):(this.cacheGeneration+=1,await this.cache.invalidateBody(n))}async refresh(e){return this.assertOpen(this.targetPath),await this.invalidateCachePrefixes([]),{added:[],removed:[],changed:e?.bodies?[`*`]:[],unchanged:0,errors:[]}}describe(){return{displayName:this.hostPath.split(`/`).filter(Boolean).at(-1)??this.hostPath,source:this.source,extra:`configured via mount table (auto-mounted, live host view)`}}async close(){this.closed=!0}getHostPath(){return this.hostPath}getTargetPath(){return this.targetPath}};export{T as HostFsMountBackend};
1
+ import{s as e,t}from"./api-endpoint-DuEQRZ4g.js";import{t as n}from"./types-D8gIX-W-.js";import{n as r}from"./fs-DouF0VP9.js";import{t as i}from"./remote-cache-3KNT1gsp.js";function a(e){if(!Number.isFinite(e))return{run:e=>e(),get active(){return 0}};let t=Math.max(1,Math.floor(e)),n=[],r=0,i=()=>{let e=n.shift();if(e){e();return}--r};return{async run(e){r>=t?await new Promise(e=>n.push(e)):r+=1;try{return await e()}finally{i()}},get active(){return r}}}var o=104857600,s=new Set([`list`,`stat`,`mkdir`,`rename`,`remove`]),c=`/api/hostfs`,l=new Set([`ENOENT`,`EEXIST`,`ENOTDIR`,`EISDIR`,`ENOTEMPTY`,`EINVAL`,`EACCES`,`ELOOP`,`EBUSY`,`EFBIG`,`EBADF`,`EIO`]),u=new Set([`list`,`stat`,`read`,`mkdir`]),d=3,f=25,p=24,m=3e4,h=4194304,g=`no-store`;function _(e,t){return`hostfs:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}var v=e=>e.json(),y=async e=>({partial:e.status===206,body:await e.arrayBuffer()}),b=async e=>{await e.arrayBuffer()},x=e=>e>0?new Promise(t=>setTimeout(t,e)):Promise.resolve();function S(e,t,r,i,a){let o=r instanceof Error?r.message:String(r),s=a?` after ${i} attempt${i===1?``:`s`}`:` (not retried: non-idempotent op)`;return new n(`EIO`,`hostfs ${e} failed${s}: transient bridge error: ${o}`,t)}function C(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function w(t){let n={},i=C(t.ctime);i!==void 0&&(n.ctime=i);let a=C(t.ino);a!==void 0&&(n.ino=a);let o=C(t.dev);o!==void 0&&Number.isSafeInteger(o)&&o>=0&&(n.dev=o,n.identity=r(`hostfs:${e(c)}`,a,o));let s=C(t.uid);s!==void 0&&(n.uid=s);let l=C(t.gid);l!==void 0&&(n.gid=l);let u=C(t.mode);return u!==void 0&&(n.mode=u),n}var T=class{kind=`hostfs`;listingStatsMatchStat=!0;source;mountId;targetPath;hostPath;fetchImpl;limiter;maxAttempts;retryDelayMs;cache;maxCachedBodyBytes;cacheGeneration=0;closed=!1;stableEndpoint=!0;constructor(e){this.targetPath=e.targetPath,this.hostPath=e.hostPath,this.source=`hostfs://${e.hostPath}`,this.mountId=e.mountId??_(e.targetPath,e.hostPath),this.fetchImpl=e.fetchImpl??fetch,this.limiter=a(e.maxInflight??p),this.maxAttempts=Math.max(1,e.maxAttempts??d),this.retryDelayMs=e.retryDelayMs??f,this.maxCachedBodyBytes=Math.max(0,e.maxCachedBodyBytes??h),this.cache=e.cache??new i({mountId:this.mountId,ttlMs:e.cacheTtlMs??m})}assertOpen(e){if(this.closed)throw new n(`EBADF`,`mount closed`,e)}bodyKey(e){return e.replace(/^\/+/,``)}async invalidateCachePrefixes(e){this.cacheGeneration+=1,await this.cache.invalidatePrefixes(e)}async cacheBodyIfCurrent(e,t,n,r){e!==this.cacheGeneration||n.byteLength>this.maxCachedBodyBytes||(await this.cache.putBody(t,n,r),e!==this.cacheGeneration&&await this.cache.invalidateBody(t))}async applyHostInvalidation(e){if(e.length===0){await this.invalidateCachePrefixes([]);return}let t=e.map(e=>e.replace(/^\/+/,``));if(t.some(e=>e.length===0||e===`.`)){await this.invalidateCachePrefixes([]);return}await this.invalidateCachePrefixes(t)}getCache(){return this.cache}url(t,n,r){let i=new URLSearchParams({mount:this.targetPath,path:n.replace(/^\/+/,``)});for(let[e,t]of Object.entries(r??{}))i.set(e,t);return e(`/api/hostfs/${t}?${i.toString()}`)}buildRequest(n,r,i){let a=t(i?.headers);if(this.stableEndpoint&&s.has(n))return{url:e(c),init:{method:`POST`,headers:{...a,"Content-Type":`application/json`},body:JSON.stringify({op:n,mount:this.targetPath,path:r.replace(/^\/+/,``),...i?.extra??{}})}};let{extra:o,...l}=i??{};return{url:this.url(n,r,i?.extra),init:{...l,headers:a}}}async request(e,t,n,r){return this.assertOpen(t),this.limiter.run(()=>this.attemptRequest(e,t,n,r))}async attemptRequest(e,t,r,i){let a=u.has(e)?this.maxAttempts:1,o=0,s;for(;o<a;){o+=1;try{return await this.routeAndConsume(e,t,r,i)}catch(e){if(e instanceof n)throw e;if(s=e,this.closed)break;o<a&&await x(this.retryDelayMs*o)}}throw S(e,t,s,o,a>1)}async routeAndConsume(e,t,n,r){let i=this.stableEndpoint&&s.has(e),a=this.buildRequest(e,t,r),o=await this.fetchImpl(a.url,a.init);if(o.ok||o.status===304)return await n(o);let{error:c,rawCode:l}=await this.errorFromResponse(e,t,o);if(i&&l===null&&(o.status===404||o.status===405))return this.stableEndpoint=!1,await this.routeAndConsume(e,t,n,r);throw c}async errorFromResponse(e,t,r){let i=`EIO`,a=null,o=`hostfs ${e} failed with HTTP ${r.status}`;try{let e=await r.json();typeof e.code==`string`&&(a=e.code,l.has(e.code)&&(i=e.code)),typeof e.message==`string`&&(o=e.message)}catch{}return{error:new n(i,o,t),rawCode:a}}async readDir(e){let t=await this.request(`list`,e,v);if(!Array.isArray(t.entries))return[];let n=[];for(let e of t.entries){let t=e;typeof t.name!=`string`||t.kind!==`file`&&t.kind!==`directory`||n.push({name:t.name,kind:t.kind,...typeof t.size==`number`?{size:t.size}:{},...typeof t.lastModified==`number`?{lastModified:t.lastModified}:{},...w(t)})}return n}async readFile(e){this.assertOpen(e);let t=this.cacheGeneration,r=this.bodyKey(e),i=await this.cache.getBody(r);if(i&&!this.cache.isStale(i.cachedAt))return i.body;let a={};i?.etag&&(a[`If-None-Match`]=i.etag);let s=await this.request(`read`,e,async e=>e.status===304?{kind:`not-modified`}:{kind:`body`,bytes:new Uint8Array(await e.arrayBuffer()),etag:e.headers.get(`etag`)??``},{cache:g,headers:a});if(s.kind===`not-modified`){if(!i)throw new n(`EIO`,`hostfs read got 304 without a cached body`,e);return await this.cacheBodyIfCurrent(t,r,i.body,i.etag),i.body}if(s.bytes.byteLength>o)throw new n(`EFBIG`,`file exceeds the hostfs body cap`,e);return await this.cacheBodyIfCurrent(t,r,s.bytes,s.etag),s.bytes}async readFileRange(e,t,r){if(!Number.isInteger(t)||!Number.isInteger(r)||t<0||r<t)throw new n(`EINVAL`,`invalid byte range ${t}-${r}`,e);if(r===t)return new Uint8Array;if(r-t>o)throw new n(`EFBIG`,`byte range exceeds the hostfs body cap`,e);let{partial:i,body:a}=await this.request(`read`,e,y,{cache:g,headers:{Range:`bytes=${t}-${r-1}`}});return i?new Uint8Array(a):new Uint8Array(a).slice(t,r)}async writeFile(e,t){if(t.byteLength>o)throw new n(`EFBIG`,`body exceeds the hostfs body cap`,e);await this.request(`write`,e,b,{method:`PUT`,headers:{"Content-Type":`application/octet-stream`},body:new Uint8Array(t)});let r=this.bodyKey(e),i=++this.cacheGeneration;t.byteLength<=this.maxCachedBodyBytes?await this.cacheBodyIfCurrent(i,r,new Uint8Array(t),``):await this.cache.invalidateBody(r)}async stat(e){let t=await this.request(`stat`,e,v);return{kind:t.kind===`directory`?`directory`:`file`,size:typeof t.size==`number`?t.size:0,mtime:typeof t.mtime==`number`?t.mtime:0,...w(t)}}async mkdir(e){await this.request(`mkdir`,e,b,{method:`POST`})}async rename(e,t){let n=await this.request(`rename`,e,v,{method:`POST`,extra:{to:t.replace(/^\/+/,``)}}),r=this.bodyKey(e),i=this.bodyKey(t);return await this.invalidateCachePrefixes([r,i]),n.noop===!0?{noop:!0}:{}}async remove(e,t){await this.request(`remove`,e,b,{method:`DELETE`,extra:t?.recursive?{recursive:`1`}:void 0});let n=this.bodyKey(e);t?.recursive?await this.invalidateCachePrefixes([n]):(this.cacheGeneration+=1,await this.cache.invalidateBody(n))}async refresh(e){return this.assertOpen(this.targetPath),await this.invalidateCachePrefixes([]),{added:[],removed:[],changed:e?.bodies?[`*`]:[],unchanged:0,errors:[]}}describe(){return{displayName:this.hostPath.split(`/`).filter(Boolean).at(-1)??this.hostPath,source:this.source,extra:`configured via mount table (auto-mounted, live host view)`}}async close(){this.closed=!0}getHostPath(){return this.hostPath}getTargetPath(){return this.targetPath}};export{T as HostFsMountBackend};
@@ -0,0 +1 @@
1
+ import{a as e}from"./diagnostics-DN_idNHx.js";import{t}from"./models-4WTk3EBD.js";import{a as n}from"./compat-uEPf6-XW.js";import{r}from"./bedrock-camp-compat-Bdpnq7TU.js";import{a as i,i as a,o,r as s}from"./claude-model-version-ceOteQ2f.js";import{a as ee,n as c,r as l,t as u}from"./transform-messages-Jn8bw4-u.js";import{t as d}from"./temperature-support-D3pN575q.js";const f={id:`bedrock-camp`,name:`AWS Bedrock`,description:`Claude on AWS Bedrock via CAMP Bearer token`,requiresApiKey:!0,apiKeyPlaceholder:`ABSK...`,apiKeyEnvVar:`BEDROCK_CAMP_API_KEY`,requiresBaseUrl:!0,baseUrlPlaceholder:`https://bedrock-runtime.us-west-2.amazonaws.com`,baseUrlDescription:`Bedrock runtime endpoint from CAMP portal`,defaultModelId:`claude-opus-5-5`},p=/^(us|eu|global|apac|au|jp)\./,m=/\.anthropic\.claude-(opus|sonnet|haiku|fable)-(?:[4-9]|\d\d)/,h=/\.(?:openai\.(?:gpt-5\.6-(?:sol|terra|luna)|gpt-6-(?:sol|luna|astra))|moonshotai\.kimi-k3)$/,te=/bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/i;function g(e){if(!e)return null;try{let{hostname:t}=new URL(e);return t.toLowerCase().match(te)?.[1]??null}catch{return null}}const ne=new Set([`ap-northeast-1`,`ap-northeast-3`]),_=new Set([`ap-southeast-2`,`ap-southeast-4`]);function v(e,t){return e===`global`?!0:e===`us`?t.startsWith(`us-`):e===`eu`?t.startsWith(`eu-`):e===`apac`?t.startsWith(`ap-`):e===`jp`?ne.has(t):e===`au`&&_.has(t)}function y(e,t){if(!p.test(e.id)||!m.test(e.id)&&!h.test(e.id))return!1;if(!t)return!0;let n=e.id.split(`.`,1)[0];return v(n,t)}function b(e,t){return d(e,t)}function x(e){return{onPayload:e.onPayload,onResponse:e.onResponse,toolChoice:e.toolChoice,thinkingDisplay:e.thinkingDisplay,interleavedThinking:e.interleavedThinking,requestMetadata:e.requestMetadata,effort:e.effort}}function S(e,t){return(t?[e,t]:[e]).flatMap(e=>{let t=e.toLowerCase();return[t,t.replace(/[\s_.:]+/g,`-`)]})}function C(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return t.length>64?t.slice(0,64):t}function w(e){return e?e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,`�`):``}function T(e){let t=e;if(t.type===`text`)return{text:w(t.text)};if(t.type===`image`)return{image:F(t.mimeType??``,t.data??``)};throw Error(`Unknown user content type: ${t.type??`unknown`}`)}function E(e){return{role:`user`,content:typeof e.content==`string`?[{text:w(e.content)}]:e.content.map(T)}}function D(e,t){let n=e.thinking??``;return n.trim().length===0?null:L(t)?!e.thinkingSignature||e.thinkingSignature.trim().length===0?{text:w(n)}:{reasoningContent:{reasoningText:{text:w(n),signature:e.thinkingSignature}}}:{reasoningContent:{reasoningText:{text:w(n)}}}}function O(e,t){let n=e;switch(n.type){case`text`:return(n.text??``).trim().length===0?null:{text:w(n.text??``)};case`toolCall`:return{toolUse:{toolUseId:n.id??``,name:n.name??``,input:n.arguments??{}}};case`thinking`:return D(n,t);default:return null}}function k(e,t){if(e.content.length===0)return null;let n=[];for(let r of e.content){let e=O(r,t);e!==null&&n.push(e)}return n.length===0?null:{role:`assistant`,content:n}}function A(e){let t=e;return t.type===`image`?{image:F(t.mimeType??``,t.data??``)}:{text:w(t.text??(typeof t.json==`string`?t.json:JSON.stringify(t.json??t)))}}function j(e){return{toolResult:{toolUseId:e.toolCallId??``,content:e.content.map(A),status:e.isError?`error`:`success`}}}function M(e,t){let n=[j(e[t])],r=t+1;for(;r<e.length&&e[r].role===`toolResult`;)n.push(j(e[r])),r++;return{message:{role:`user`,content:n},nextIndex:r-1}}function N(e,t,n){if(n===`none`||!q(t)||e.length===0)return;let r=e[e.length-1];r.role===`user`&&Array.isArray(r.content)&&r.content.push(J(n))}function P(e,t,n){let r=[],i=u(e.messages,t,C);for(let e=0;e<i.length;e++){let n=i[e];if(n.role===`user`)r.push(E(n));else if(n.role===`assistant`){let e=k(n,t);e!==null&&r.push(e)}else if(n.role===`toolResult`){let{message:t,nextIndex:n}=M(i,e);r.push(t),e=n}}return N(r,t,n),r}function F(e,t){return{source:{bytes:t},format:I(e)}}function I(e){switch(e){case`image/jpeg`:case`image/jpg`:return`jpeg`;case`image/png`:return`png`;case`image/gif`:return`gif`;case`image/webp`:return`webp`;default:throw Error(`Unsupported image MIME type: ${e}`)}}function L(e){return K(e)}function R(e,t){return s(e,t)}function z(e,t){return i(e,t)}function B(e,t){return a(e,t)}function re(e,t){if(!e?.length||t===`none`)return;let n=e.map(e=>({toolSpec:{name:e.name,description:e.description,inputSchema:{json:e.parameters}}})),r;switch(t){case`auto`:r={auto:{}};break;case`any`:r={any:{}};break;default:t&&typeof t==`object`&&t.type===`tool`&&(r={tool:{name:t.name}})}return{tools:n,toolChoice:r}}function V(e,t,n){if(e===`xhigh`&&z(t,n))return`xhigh`;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`high`:return`high`;case`xhigh`:return B(t,n)?`max`:`high`;default:return`high`}}function H(e){if(g(e.baseUrl)?.toLowerCase().startsWith(`us-gov-`))return!0;let t=e.id.toLowerCase();return t.startsWith(`us-gov.`)||t.startsWith(`arn:aws-us-gov:`)}const U=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`];function W(e,t){if(!t.reasoning)return e.off??void 0;if(t.effort===`max`&&e.max)return e.max;let n=U.indexOf(t.reasoning);for(let t of U.slice(Math.max(n,0))){let n=e[t];if(n)return n}}function G(e,t){let n=r(e);if(n){let e=W(n,t);return e===void 0?void 0:{reasoning:{effort:e}}}if(!t.reasoning||!e.reasoning||!K(e))return;let i=H(e)?void 0:t.thinkingDisplay??`summarized`;if(R(e.id,e.name))return{thinking:{type:`adaptive`,...i===void 0?{}:{display:i}},output_config:{effort:V(t.reasoning,e.id,e.name)}};let a={minimal:1024,low:2048,medium:8192,high:16384,xhigh:16384},o=t.reasoning===`xhigh`?`high`:t.reasoning,s={thinking:{type:`enabled`,budget_tokens:t.thinkingBudgets?.[o]??a[t.reasoning],...i===void 0?{}:{display:i}}};return(t.interleavedThinking??!0)&&(s.anthropic_beta=[`interleaved-thinking-2025-05-14`]),s}function K(e){let t=e.id.toLowerCase(),n=e.name?.toLowerCase()??``;return t.includes(`anthropic.claude`)||t.includes(`anthropic/claude`)||n.includes(`anthropic.claude`)||n.includes(`anthropic/claude`)||n.includes(`claude`)}function q(e){return S(e.id,e.name).some(e=>e.includes(`claude`))?o(e.id,e.name):!1}function J(e){return{cachePoint:{type:`default`,...e===`long`?{ttl:`1h`}:{}}}}function Y(e,t,n){if(!e)return;let r=[{text:w(e)}];return n!==`none`&&q(t)&&r.push(J(n)),r}function X(e){switch(e){case`end_turn`:case`stop_sequence`:return`stop`;case`max_tokens`:case`model_context_window_exceeded`:return`length`;case`tool_use`:return`toolUse`;default:return`error`}}function ie(e,t){let n=`Bedrock CAMP API error (${e})`;return e===429?n=`Throttling error: ${n}`:e===503?n=`Service unavailable: ${n}`:e===502||e===504||e>=500?n=`Internal server error: ${n}`:e===400&&(n=`Validation error: ${n}`),`${n}: ${t}`}function ae(e,n,r,i){let a=e;i.push({type:`start`,partial:r});let o=a.output?.message;if(o?.content)for(let e=0;e<o.content.length;e++){let t=o.content[e];if(t.text!==void 0){let e={type:`text`,text:t.text};r.content.push(e);let n=r.content.length-1;i.push({type:`text_start`,contentIndex:n,partial:r}),i.push({type:`text_delta`,contentIndex:n,delta:t.text,partial:r}),i.push({type:`text_end`,contentIndex:n,content:t.text,partial:r})}else if(t.toolUse){let e={type:`toolCall`,id:t.toolUse.toolUseId||``,name:t.toolUse.name||``,arguments:t.toolUse.input||{}};r.content.push(e);let n=r.content.length-1;i.push({type:`toolcall_start`,contentIndex:n,partial:r}),i.push({type:`toolcall_end`,contentIndex:n,toolCall:e,partial:r})}else if(t.reasoningContent?.reasoningText){let e={type:`thinking`,thinking:t.reasoningContent.reasoningText.text||``,thinkingSignature:t.reasoningContent.reasoningText.signature||``};r.content.push(e);let n=r.content.length-1;i.push({type:`thinking_start`,contentIndex:n,partial:r}),i.push({type:`thinking_delta`,contentIndex:n,delta:e.thinking,partial:r}),i.push({type:`thinking_end`,contentIndex:n,content:e.thinking,partial:r})}}a.usage&&(r.usage.input=a.usage.inputTokens||0,r.usage.output=a.usage.outputTokens||0,r.usage.cacheRead=a.usage.cacheReadInputTokens||0,r.usage.cacheWrite=a.usage.cacheWriteInputTokens||0,r.usage.totalTokens=a.usage.totalTokens||r.usage.input+r.usage.output,t(n,r.usage)),r.stopReason=X(a.stopReason||`end_turn`)}function oe(e){return e??`short`}function se(e){let t={};return e.headers.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function ce(e){return{role:`assistant`,content:[],api:`bedrock-camp-converse`,provider:e.provider,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:`stop`,timestamp:Date.now()}}function Z(e,t){let n={};return t.maxTokens!==void 0&&(n.maxTokens=t.maxTokens),t.temperature!==void 0&&b(e.id,e.name)&&(n.temperature=t.temperature),n}function le(e,t,n,r){let i=Y(t.systemPrompt,e,r),a=re(t.tools,n.toolChoice),o=G(e,n);return{modelId:e.id,messages:P(t,e,r),inferenceConfig:Z(e,n),...i===void 0?{}:{system:i},...a===void 0?{}:{toolConfig:a},...o===void 0?{}:{additionalModelRequestFields:o},...n.requestMetadata===void 0?{}:{requestMetadata:n.requestMetadata}}}async function ue(e,t,n){if(!n.onPayload)return e;let r=await n.onPayload(e,t);if(r===void 0)return e;if(!de(r))throw Error(`Bedrock CAMP onPayload hook must return a converse request body`);return r}function de(e){return typeof e!=`object`||!e?!1:`modelId`in e&&typeof e.modelId==`string`&&`messages`in e&&Array.isArray(e.messages)}async function fe(e,t,n,r,i){let a={"Content-Type":`application/json`,Authorization:`Bearer ${t}`,...i.headers??{}},o=await fetch(e,{method:`POST`,headers:a,body:JSON.stringify(n),signal:i.signal});if(i.onResponse&&await i.onResponse({status:o.status,headers:se(o)},r),!o.ok){let e=await o.text();throw Error(ie(o.status,e))}return o}function pe(e,t,n,r){for(let e of t.content){let t=e;delete t.index,delete t.partialJson}t.stopReason=n.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),r.push({type:`error`,reason:t.stopReason,error:t}),r.end()}async function me(e,t,n,r,i){let a=n.apiKey;if(!a)throw Error(`API key is required for Bedrock CAMP`);let o=e.baseUrl;if(!o)throw Error(`Base URL is required for Bedrock CAMP`);let s=le(e,t,n,oe(n.cacheRetention));if(s=await ue(s,e,n),ae(await(await fe(`${o.replace(/\/$/,``)}/model/${e.id}/converse`,a,s,e,n)).json(),e,r,i),r.stopReason===`pending`)throw Error(`Bedrock CAMP response ended without a stop reason`);if(r.stopReason===`error`||r.stopReason===`aborted`)throw Error(`An unknown error occurred`);i.push({type:`done`,reason:r.stopReason,message:r}),i.end()}const Q=(t,n,r={})=>{let i=e(),a=ce(t);return he(t,n,r,a,i).catch(e=>{pe(e,a,r,i)}),i};async function he(e,t,n,r,i){await me(e,t,n,r,i)}const $=(e,t,n)=>{let r=l(e,t,n),i=n?x(n):{};if(!n?.reasoning)return Q(e,t,{...r,...i,reasoning:void 0});if(K(e)){if(R(e.id,e.name))return Q(e,t,{...r,...i,reasoning:n.reasoning,thinkingBudgets:n.thinkingBudgets});let a=c(r.maxTokens||0,e.maxTokens,n.reasoning,n.thinkingBudgets);return Q(e,t,{...r,...i,maxTokens:a.maxTokens,reasoning:n.reasoning,thinkingBudgets:{...n.thinkingBudgets||{},[ee(n.reasoning)]:a.budgetTokens}})}return Q(e,t,{...r,...i,reasoning:n.reasoning,thinkingBudgets:n.thinkingBudgets})};function ge(){n({api:`bedrock-camp-converse`,stream:Q,streamSimple:$})}export{g as bedrockCampRegionFromBaseUrl,f as config,y as isBedrockCampCompatible,ge as register,Q as streamBedrockCamp,$ as streamSimpleBedrockCamp};
@@ -0,0 +1 @@
1
+ import{a as e}from"./diagnostics-DN_idNHx.js";import{t}from"./models-BSkXF4T6.js";import{a as n}from"./compat-qQM4gjF_.js";import{r}from"./bedrock-camp-compat-Bz7u6y4g.js";import{a as i,i as a,n as o,r as s}from"./claude-model-version-DZmbk9E2.js";import{a as ee,n as c,r as l,t as u}from"./transform-messages-BsQjTIEJ.js";import{t as d}from"./temperature-support-CIu8ekGh.js";var f={id:`bedrock-camp`,name:`AWS Bedrock`,description:`Claude on AWS Bedrock via CAMP Bearer token`,requiresApiKey:!0,apiKeyPlaceholder:`ABSK...`,apiKeyEnvVar:`BEDROCK_CAMP_API_KEY`,requiresBaseUrl:!0,baseUrlPlaceholder:`https://bedrock-runtime.us-west-2.amazonaws.com`,baseUrlDescription:`Bedrock runtime endpoint from CAMP portal`,defaultModelId:`claude-opus-5-5`},p=/^(us|eu|global|apac|au|jp)\./,m=/\.anthropic\.claude-(opus|sonnet|haiku|fable)-(?:[4-9]|\d\d)/,h=/\.(?:openai\.(?:gpt-5\.6-(?:sol|terra|luna)|gpt-6-(?:sol|luna|astra))|moonshotai\.kimi-k3)$/,te=/bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/i;function g(e){if(!e)return null;try{let{hostname:t}=new URL(e);return t.toLowerCase().match(te)?.[1]??null}catch{return null}}var ne=new Set([`ap-northeast-1`,`ap-northeast-3`]),_=new Set([`ap-southeast-2`,`ap-southeast-4`]);function v(e,t){return e===`global`?!0:e===`us`?t.startsWith(`us-`):e===`eu`?t.startsWith(`eu-`):e===`apac`?t.startsWith(`ap-`):e===`jp`?ne.has(t):e===`au`&&_.has(t)}function y(e,t){if(!p.test(e.id)||!m.test(e.id)&&!h.test(e.id))return!1;if(!t)return!0;let n=e.id.split(`.`,1)[0];return v(n,t)}function b(e,t){return d(e,t)}function x(e){return{onPayload:e.onPayload,onResponse:e.onResponse,toolChoice:e.toolChoice,thinkingDisplay:e.thinkingDisplay,interleavedThinking:e.interleavedThinking,requestMetadata:e.requestMetadata,effort:e.effort}}function S(e,t){return(t?[e,t]:[e]).flatMap(e=>{let t=e.toLowerCase();return[t,t.replace(/[\s_.:]+/g,`-`)]})}function C(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return t.length>64?t.slice(0,64):t}function w(e){return e?e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,`�`):``}function T(e){let t=e;if(t.type===`text`)return{text:w(t.text)};if(t.type===`image`)return{image:F(t.mimeType??``,t.data??``)};throw Error(`Unknown user content type: ${t.type??`unknown`}`)}function E(e){return{role:`user`,content:typeof e.content==`string`?[{text:w(e.content)}]:e.content.map(T)}}function D(e,t){let n=e.thinking??``;return n.trim().length===0?null:L(t)?!e.thinkingSignature||e.thinkingSignature.trim().length===0?{text:w(n)}:{reasoningContent:{reasoningText:{text:w(n),signature:e.thinkingSignature}}}:{reasoningContent:{reasoningText:{text:w(n)}}}}function O(e,t){let n=e;switch(n.type){case`text`:return(n.text??``).trim().length===0?null:{text:w(n.text??``)};case`toolCall`:return{toolUse:{toolUseId:n.id??``,name:n.name??``,input:n.arguments??{}}};case`thinking`:return D(n,t);default:return null}}function k(e,t){if(e.content.length===0)return null;let n=[];for(let r of e.content){let e=O(r,t);e!==null&&n.push(e)}return n.length===0?null:{role:`assistant`,content:n}}function A(e){let t=e;return t.type===`image`?{image:F(t.mimeType??``,t.data??``)}:{text:w(t.text??(typeof t.json==`string`?t.json:JSON.stringify(t.json??t)))}}function j(e){return{toolResult:{toolUseId:e.toolCallId??``,content:e.content.map(A),status:e.isError?`error`:`success`}}}function M(e,t){let n=[j(e[t])],r=t+1;for(;r<e.length&&e[r].role===`toolResult`;)n.push(j(e[r])),r++;return{message:{role:`user`,content:n},nextIndex:r-1}}function N(e,t,n){if(n===`none`||!q(t)||e.length===0)return;let r=e[e.length-1];r.role===`user`&&Array.isArray(r.content)&&r.content.push(J(n))}function P(e,t,n){let r=[],i=u(e.messages,t,C);for(let e=0;e<i.length;e++){let n=i[e];if(n.role===`user`)r.push(E(n));else if(n.role===`assistant`){let e=k(n,t);e!==null&&r.push(e)}else if(n.role===`toolResult`){let{message:t,nextIndex:n}=M(i,e);r.push(t),e=n}}return N(r,t,n),r}function F(e,t){return{source:{bytes:t},format:I(e)}}function I(e){switch(e){case`image/jpeg`:case`image/jpg`:return`jpeg`;case`image/png`:return`png`;case`image/gif`:return`gif`;case`image/webp`:return`webp`;default:throw Error(`Unsupported image MIME type: ${e}`)}}function L(e){return K(e)}function R(e,t){return o(e,t)}function z(e,t){return a(e,t)}function B(e,t){return s(e,t)}function re(e,t){if(!e?.length||t===`none`)return;let n=e.map(e=>({toolSpec:{name:e.name,description:e.description,inputSchema:{json:e.parameters}}})),r;switch(t){case`auto`:r={auto:{}};break;case`any`:r={any:{}};break;default:t&&typeof t==`object`&&t.type===`tool`&&(r={tool:{name:t.name}})}return{tools:n,toolChoice:r}}function V(e,t,n){if(e===`xhigh`&&z(t,n))return`xhigh`;switch(e){case`minimal`:case`low`:return`low`;case`medium`:return`medium`;case`high`:return`high`;case`xhigh`:return B(t,n)?`max`:`high`;default:return`high`}}function H(e){if(g(e.baseUrl)?.toLowerCase().startsWith(`us-gov-`))return!0;let t=e.id.toLowerCase();return t.startsWith(`us-gov.`)||t.startsWith(`arn:aws-us-gov:`)}var U=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`];function W(e,t){if(!t.reasoning)return e.off??void 0;if(t.effort===`max`&&e.max)return e.max;let n=U.indexOf(t.reasoning);for(let t of U.slice(Math.max(n,0))){let n=e[t];if(n)return n}}function G(e,t){let n=r(e);if(n){let e=W(n,t);return e===void 0?void 0:{reasoning:{effort:e}}}if(!t.reasoning||!e.reasoning||!K(e))return;let i=H(e)?void 0:t.thinkingDisplay??`summarized`;if(R(e.id,e.name))return{thinking:{type:`adaptive`,...i===void 0?{}:{display:i}},output_config:{effort:V(t.reasoning,e.id,e.name)}};let a={minimal:1024,low:2048,medium:8192,high:16384,xhigh:16384},o=t.reasoning===`xhigh`?`high`:t.reasoning,s={thinking:{type:`enabled`,budget_tokens:t.thinkingBudgets?.[o]??a[t.reasoning],...i===void 0?{}:{display:i}}};return(t.interleavedThinking??!0)&&(s.anthropic_beta=[`interleaved-thinking-2025-05-14`]),s}function K(e){let t=e.id.toLowerCase(),n=e.name?.toLowerCase()??``;return t.includes(`anthropic.claude`)||t.includes(`anthropic/claude`)||n.includes(`anthropic.claude`)||n.includes(`anthropic/claude`)||n.includes(`claude`)}function q(e){return S(e.id,e.name).some(e=>e.includes(`claude`))?i(e.id,e.name):!1}function J(e){return{cachePoint:{type:`default`,...e===`long`?{ttl:`1h`}:{}}}}function Y(e,t,n){if(!e)return;let r=[{text:w(e)}];return n!==`none`&&q(t)&&r.push(J(n)),r}function X(e){switch(e){case`end_turn`:case`stop_sequence`:return`stop`;case`max_tokens`:case`model_context_window_exceeded`:return`length`;case`tool_use`:return`toolUse`;default:return`error`}}function ie(e,t){let n=`Bedrock CAMP API error (${e})`;return e===429?n=`Throttling error: ${n}`:e===503?n=`Service unavailable: ${n}`:e===502||e===504||e>=500?n=`Internal server error: ${n}`:e===400&&(n=`Validation error: ${n}`),`${n}: ${t}`}function ae(e,n,r,i){let a=e;i.push({type:`start`,partial:r});let o=a.output?.message;if(o?.content)for(let e=0;e<o.content.length;e++){let t=o.content[e];if(t.text!==void 0){let e={type:`text`,text:t.text};r.content.push(e);let n=r.content.length-1;i.push({type:`text_start`,contentIndex:n,partial:r}),i.push({type:`text_delta`,contentIndex:n,delta:t.text,partial:r}),i.push({type:`text_end`,contentIndex:n,content:t.text,partial:r})}else if(t.toolUse){let e={type:`toolCall`,id:t.toolUse.toolUseId||``,name:t.toolUse.name||``,arguments:t.toolUse.input||{}};r.content.push(e);let n=r.content.length-1;i.push({type:`toolcall_start`,contentIndex:n,partial:r}),i.push({type:`toolcall_end`,contentIndex:n,toolCall:e,partial:r})}else if(t.reasoningContent?.reasoningText){let e={type:`thinking`,thinking:t.reasoningContent.reasoningText.text||``,thinkingSignature:t.reasoningContent.reasoningText.signature||``};r.content.push(e);let n=r.content.length-1;i.push({type:`thinking_start`,contentIndex:n,partial:r}),i.push({type:`thinking_delta`,contentIndex:n,delta:e.thinking,partial:r}),i.push({type:`thinking_end`,contentIndex:n,content:e.thinking,partial:r})}}a.usage&&(r.usage.input=a.usage.inputTokens||0,r.usage.output=a.usage.outputTokens||0,r.usage.cacheRead=a.usage.cacheReadInputTokens||0,r.usage.cacheWrite=a.usage.cacheWriteInputTokens||0,r.usage.totalTokens=a.usage.totalTokens||r.usage.input+r.usage.output,t(n,r.usage)),r.stopReason=X(a.stopReason||`end_turn`)}function oe(e){return e??`short`}function se(e){let t={};return e.headers.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function ce(e){return{role:`assistant`,content:[],api:`bedrock-camp-converse`,provider:e.provider,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:`stop`,timestamp:Date.now()}}function Z(e,t){let n={};return t.maxTokens!==void 0&&(n.maxTokens=t.maxTokens),t.temperature!==void 0&&b(e.id,e.name)&&(n.temperature=t.temperature),n}function le(e,t,n,r){let i=Y(t.systemPrompt,e,r),a=re(t.tools,n.toolChoice),o=G(e,n);return{modelId:e.id,messages:P(t,e,r),inferenceConfig:Z(e,n),...i===void 0?{}:{system:i},...a===void 0?{}:{toolConfig:a},...o===void 0?{}:{additionalModelRequestFields:o},...n.requestMetadata===void 0?{}:{requestMetadata:n.requestMetadata}}}async function ue(e,t,n){if(!n.onPayload)return e;let r=await n.onPayload(e,t);if(r===void 0)return e;if(!de(r))throw Error(`Bedrock CAMP onPayload hook must return a converse request body`);return r}function de(e){return typeof e!=`object`||!e?!1:`modelId`in e&&typeof e.modelId==`string`&&`messages`in e&&Array.isArray(e.messages)}async function fe(e,t,n,r,i){let a={"Content-Type":`application/json`,Authorization:`Bearer ${t}`,...i.headers??{}},o=await fetch(e,{method:`POST`,headers:a,body:JSON.stringify(n),signal:i.signal});if(i.onResponse&&await i.onResponse({status:o.status,headers:se(o)},r),!o.ok){let e=await o.text();throw Error(ie(o.status,e))}return o}function pe(e,t,n,r){for(let e of t.content){let t=e;delete t.index,delete t.partialJson}t.stopReason=n.signal?.aborted?`aborted`:`error`,t.errorMessage=e instanceof Error?e.message:JSON.stringify(e),r.push({type:`error`,reason:t.stopReason,error:t}),r.end()}async function me(e,t,n,r,i){let a=n.apiKey;if(!a)throw Error(`API key is required for Bedrock CAMP`);let o=e.baseUrl;if(!o)throw Error(`Base URL is required for Bedrock CAMP`);let s=le(e,t,n,oe(n.cacheRetention));if(s=await ue(s,e,n),ae(await(await fe(`${o.replace(/\/$/,``)}/model/${e.id}/converse`,a,s,e,n)).json(),e,r,i),r.stopReason===`pending`)throw Error(`Bedrock CAMP response ended without a stop reason`);if(r.stopReason===`error`||r.stopReason===`aborted`)throw Error(`An unknown error occurred`);i.push({type:`done`,reason:r.stopReason,message:r}),i.end()}var Q=(t,n,r={})=>{let i=e(),a=ce(t);return he(t,n,r,a,i).catch(e=>{pe(e,a,r,i)}),i};async function he(e,t,n,r,i){await me(e,t,n,r,i)}var $=(e,t,n)=>{let r=l(e,t,n),i=n?x(n):{};if(!n?.reasoning)return Q(e,t,{...r,...i,reasoning:void 0});if(K(e)){if(R(e.id,e.name))return Q(e,t,{...r,...i,reasoning:n.reasoning,thinkingBudgets:n.thinkingBudgets});let a=c(r.maxTokens||0,e.maxTokens,n.reasoning,n.thinkingBudgets);return Q(e,t,{...r,...i,maxTokens:a.maxTokens,reasoning:n.reasoning,thinkingBudgets:{...n.thinkingBudgets||{},[ee(n.reasoning)]:a.budgetTokens}})}return Q(e,t,{...r,...i,reasoning:n.reasoning,thinkingBudgets:n.thinkingBudgets})};function ge(){n({api:`bedrock-camp-converse`,stream:Q,streamSimple:$})}export{g as bedrockCampRegionFromBaseUrl,f as config,y as isBedrockCampCompatible,ge as register,Q as streamBedrockCamp,$ as streamSimpleBedrockCamp};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";var t=e({BEDROCK_CAMP_GPT6_ASTRA_EFFORT_MAP:()=>f,BEDROCK_CAMP_GPT6_EFFORT_MAP:()=>d,bedrockCampOpenAIEffortMap:()=>m,bedrockCampRegionFromBaseUrl:()=>o,isBedrockCampClaudeModel:()=>u,isBedrockCampCompatible:()=>h});const n=/^(us|eu|global|apac|au|jp)\./,r=/\.anthropic\.claude-(opus|sonnet|haiku|fable)-(?:[4-9]|\d\d)/,i=/\.(?:openai\.(?:gpt-5\.6-(?:sol|terra|luna)|gpt-6-(?:sol|luna|astra))|moonshotai\.kimi-k3)$/,a=/bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/i;function o(e){if(!e)return null;try{let{hostname:t}=new URL(e);return t.toLowerCase().match(a)?.[1]??null}catch{return null}}const s=new Set([`ap-northeast-1`,`ap-northeast-3`]),c=new Set([`ap-southeast-2`,`ap-southeast-4`]);function l(e,t){return e===`global`?!0:e===`us`?t.startsWith(`us-`):e===`eu`?t.startsWith(`eu-`):e===`apac`?t.startsWith(`ap-`):e===`jp`?s.has(t):e===`au`&&c.has(t)}function u(e){return r.test(e.id)}const d=Object.freeze({off:`none`,minimal:null,low:`low`,medium:`medium`,high:`high`,xhigh:`xhigh`,max:`max`}),f=Object.freeze({...d,off:null}),p=/\.openai\.gpt-6-(sol|luna|astra)$/;function m(e){let t=p.exec(e.id)?.[1];return t?t===`astra`?f:d:null}function h(e,t){if(!n.test(e.id)||!r.test(e.id)&&!i.test(e.id))return!1;if(!t)return!0;let a=e.id.split(`.`,1)[0];return l(a,t)}export{t as a,o as i,d as n,u as o,m as r,h as s,f as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";var t=e({BEDROCK_CAMP_GPT6_ASTRA_EFFORT_MAP:()=>f,BEDROCK_CAMP_GPT6_EFFORT_MAP:()=>d,bedrockCampOpenAIEffortMap:()=>m,bedrockCampRegionFromBaseUrl:()=>o,isBedrockCampClaudeModel:()=>u,isBedrockCampCompatible:()=>h}),n=/^(us|eu|global|apac|au|jp)\./,r=/\.anthropic\.claude-(opus|sonnet|haiku|fable)-(?:[4-9]|\d\d)/,i=/\.(?:openai\.(?:gpt-5\.6-(?:sol|terra|luna)|gpt-6-(?:sol|luna|astra))|moonshotai\.kimi-k3)$/,a=/bedrock-runtime(?:-fips)?\.([a-z0-9-]+)\.amazonaws\.com(?:\.cn)?$/i;function o(e){if(!e)return null;try{let{hostname:t}=new URL(e);return t.toLowerCase().match(a)?.[1]??null}catch{return null}}var s=new Set([`ap-northeast-1`,`ap-northeast-3`]),c=new Set([`ap-southeast-2`,`ap-southeast-4`]);function l(e,t){return e===`global`?!0:e===`us`?t.startsWith(`us-`):e===`eu`?t.startsWith(`eu-`):e===`apac`?t.startsWith(`ap-`):e===`jp`?s.has(t):e===`au`&&c.has(t)}function u(e){return r.test(e.id)}var d=Object.freeze({off:`none`,minimal:null,low:`low`,medium:`medium`,high:`high`,xhigh:`xhigh`,max:`max`}),f=Object.freeze({...d,off:null}),p=/\.openai\.gpt-6-(sol|luna|astra)$/;function m(e){let t=p.exec(e.id)?.[1];return t?t===`astra`?f:d:null}function h(e,t){if(!n.test(e.id)||!r.test(e.id)&&!i.test(e.id))return!1;if(!t)return!0;let a=e.id.split(`.`,1)[0];return l(a,t)}export{t as a,o as i,d as n,u as o,m as r,h as s,f as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./bedrock-camp-compat-Bdpnq7TU.js";var r=e({BEDROCK_CAMP_EXTRA_MODELS:()=>u,mergeBedrockCampCatalogue:()=>p});const i=e=>Math.round(e*1e6)/1e6;function a(e,t){return{input:i(e.input*t),output:i(e.output*t),cacheRead:i(e.cacheRead*t),cacheWrite:i(e.cacheWrite*t)}}function o(e,t){let n=a(e,t);return e.tiers&&(n.tiers=e.tiers.map(e=>({...a(e,t),inputTokensAbove:e.inputTokensAbove}))),n}const s={global:`Global`,us:`US`,eu:`EU`,jp:`JP`,au:`AU`},c=[{baseId:`anthropic.claude-opus-5-5`,name:`Claude Opus 5.5`,profiles:[`global`,`us`,`eu`,`jp`,`au`],globalCost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:`xhigh`,max:`max`}},{baseId:`anthropic.claude-fable-5-1`,name:`Claude Fable 5.1`,profiles:[`global`,`us`],globalCost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:`xhigh`,max:`max`}},{baseId:`openai.gpt-6-sol`,name:`GPT-6 Sol`,profiles:[`global`,`us`],globalCost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:t},{baseId:`openai.gpt-6-luna`,name:`GPT-6 Luna`,profiles:[`global`,`us`],globalCost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:t},{baseId:`openai.gpt-6-astra`,name:`GPT-6 Astra`,profiles:[`global`,`us`],globalCost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:n},{baseId:`moonshotai.kimi-k3`,name:`Kimi K3`,profiles:[`global`,`us`],globalCost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1048576,maxTokens:128e3}];function l(e){return e.profiles.map(t=>({id:`${t}.${e.baseId}`,name:`${e.name} (${s[t]})`,api:`bedrock-converse-stream`,provider:`amazon-bedrock`,baseUrl:`https://bedrock-runtime.us-east-1.amazonaws.com`,reasoning:!0,input:[`text`,`image`],cost:o(e.globalCost,t===`global`?1:1.1),contextWindow:e.contextWindow,maxTokens:e.maxTokens,...e.thinkingLevelMap?{thinkingLevelMap:{...e.thinkingLevelMap}}:{}}))}const u=c.flatMap(l);function d(e,t){return e.input===t.input&&e.output===t.output&&e.cacheRead===t.cacheRead&&e.cacheWrite===t.cacheWrite}function f(e,t){let n=t?.cost;return!n?.tiers||!e.cost||e.cost.tiers||!d(e.cost,n)?e:{...e,cost:{...e.cost,tiers:n.tiers.map(e=>({...e}))}}}function p(e,t){let n=new Map(t.map(e=>[e.id,e])),r=new Set(e.map(e=>e.id));return[...e.map(e=>f(e,n.get(e.id))),...t.filter(e=>!r.has(e.id))]}export{r as n,p as r,u as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./bedrock-camp-compat-Bz7u6y4g.js";var r=e({BEDROCK_CAMP_EXTRA_MODELS:()=>d,mergeBedrockCampCatalogue:()=>m}),i=1.1,a=e=>Math.round(e*1e6)/1e6;function o(e,t){return{input:a(e.input*t),output:a(e.output*t),cacheRead:a(e.cacheRead*t),cacheWrite:a(e.cacheWrite*t)}}function s(e,t){let n=o(e,t);return e.tiers&&(n.tiers=e.tiers.map(e=>({...o(e,t),inputTokensAbove:e.inputTokensAbove}))),n}var c={global:`Global`,us:`US`,eu:`EU`,jp:`JP`,au:`AU`},l=[{baseId:`anthropic.claude-opus-5-5`,name:`Claude Opus 5.5`,profiles:[`global`,`us`,`eu`,`jp`,`au`],globalCost:{input:4,output:20,cacheRead:.2,cacheWrite:5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{xhigh:`xhigh`,max:`max`}},{baseId:`anthropic.claude-fable-5-1`,name:`Claude Fable 5.1`,profiles:[`global`,`us`],globalCost:{input:10,output:50,cacheRead:.25,cacheWrite:12.5},contextWindow:1e6,maxTokens:128e3,thinkingLevelMap:{off:null,xhigh:`xhigh`,max:`max`}},{baseId:`openai.gpt-6-sol`,name:`GPT-6 Sol`,profiles:[`global`,`us`],globalCost:{input:2,output:10,cacheRead:.2,cacheWrite:2.5,tiers:[{inputTokensAbove:272e3,input:4,output:15,cacheRead:.4,cacheWrite:5}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:t},{baseId:`openai.gpt-6-luna`,name:`GPT-6 Luna`,profiles:[`global`,`us`],globalCost:{input:.1,output:.5,cacheRead:.01,cacheWrite:.125,tiers:[{inputTokensAbove:272e3,input:.2,output:.75,cacheRead:.02,cacheWrite:.25}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:t},{baseId:`openai.gpt-6-astra`,name:`GPT-6 Astra`,profiles:[`global`,`us`],globalCost:{input:10,output:50,cacheRead:1,cacheWrite:12.5,tiers:[{inputTokensAbove:272e3,input:20,output:75,cacheRead:2,cacheWrite:25}]},contextWindow:105e4,maxTokens:128e3,thinkingLevelMap:n},{baseId:`moonshotai.kimi-k3`,name:`Kimi K3`,profiles:[`global`,`us`],globalCost:{input:3,output:15,cacheRead:.3,cacheWrite:3.75},contextWindow:1048576,maxTokens:128e3}];function u(e){return e.profiles.map(t=>({id:`${t}.${e.baseId}`,name:`${e.name} (${c[t]})`,api:`bedrock-converse-stream`,provider:`amazon-bedrock`,baseUrl:`https://bedrock-runtime.us-east-1.amazonaws.com`,reasoning:!0,input:[`text`,`image`],cost:s(e.globalCost,t===`global`?1:i),contextWindow:e.contextWindow,maxTokens:e.maxTokens,...e.thinkingLevelMap?{thinkingLevelMap:{...e.thinkingLevelMap}}:{}}))}var d=l.flatMap(u);function f(e,t){return e.input===t.input&&e.output===t.output&&e.cacheRead===t.cacheRead&&e.cacheWrite===t.cacheWrite}function p(e,t){let n=t?.cost;return!n?.tiers||!e.cost||e.cost.tiers||!f(e.cost,n)?e:{...e,cost:{...e.cost,tiers:n.tiers.map(e=>({...e}))}}}function m(e,t){let n=new Map(t.map(e=>[e.id,e])),r=new Set(e.map(e=>e.id));return[...e.map(e=>p(e,n.get(e.id))),...t.filter(e=>!r.has(e.id))]}export{r as n,m as r,d as t};