shadow-claw 1.28.0 → 1.29.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 (194) hide show
  1. package/.well-known/mcp/server-card.json +1 -1
  2. package/.well-known/mcp.json +1 -1
  3. package/README.md +96 -278
  4. package/bin/cli.mjs +4 -0
  5. package/bin/commands/mcp.mjs +409 -125
  6. package/bin/commands/mcp.test.mjs +151 -18
  7. package/bin/utils/control-client.mjs +338 -103
  8. package/bin/utils/control-client.test.mjs +14 -0
  9. package/dist/electron/main.cjs +179 -179
  10. package/dist/lib/components/index.js +21 -21
  11. package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
  12. package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
  13. package/dist/lib/components/settings/shadow-claw-git.js +1 -1
  14. package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
  15. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  16. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  17. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  18. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  19. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  20. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  21. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  22. package/dist/lib/components/shadow-claw-channels.js +1 -1
  23. package/dist/lib/components/shadow-claw-chat.js +1 -1
  24. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  25. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  26. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  27. package/dist/lib/components/shadow-claw-files.js +1 -1
  28. package/dist/lib/components/shadow-claw-git.js +1 -1
  29. package/dist/lib/components/shadow-claw-llm.js +1 -1
  30. package/dist/lib/components/shadow-claw-networking.js +1 -1
  31. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  32. package/dist/lib/components/shadow-claw-pages.js +1 -1
  33. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  34. package/dist/lib/components/shadow-claw-settings.js +1 -1
  35. package/dist/lib/components/shadow-claw-storage.js +1 -1
  36. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  37. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  38. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  39. package/dist/lib/components/shadow-claw-tools.js +1 -1
  40. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  41. package/dist/lib/components/shadow-claw.js +1 -1
  42. package/dist/lib/{configurePeerJs-D8Ph0-A9.js → configurePeerJs-DG4hliKp.js} +2 -2
  43. package/dist/lib/{configurePeerJs-D8Ph0-A9.js.map → configurePeerJs-DG4hliKp.js.map} +1 -1
  44. package/dist/lib/index.js +21 -21
  45. package/dist/lib/{initControlPlane-BIrWmpzc.js → initControlPlane-DnpAzphg.js} +8 -8
  46. package/dist/lib/{initControlPlane-BIrWmpzc.js.map → initControlPlane-DnpAzphg.js.map} +1 -1
  47. package/dist/lib/{markdown-DEUoM1c6.js → markdown-DgdSt2GD.js} +2 -2
  48. package/dist/lib/{markdown-DEUoM1c6.js.map → markdown-DgdSt2GD.js.map} +1 -1
  49. package/dist/lib/{orchestrator-CFCW-l1O.js → orchestrator-CjEau_RG.js} +5 -5
  50. package/dist/lib/{orchestrator-CFCW-l1O.js.map → orchestrator-CjEau_RG.js.map} +1 -1
  51. package/dist/lib/{orchestrator-BtVj9bBB.js → orchestrator-ClXbJ4Mb.js} +2 -2
  52. package/dist/lib/{orchestrator-BtVj9bBB.js.map → orchestrator-ClXbJ4Mb.js.map} +1 -1
  53. package/dist/lib/{peerjs-BoBkx9DJ.js → peerjs-BdfpltIe.js} +3 -3
  54. package/dist/lib/{peerjs-BoBkx9DJ.js.map → peerjs-BdfpltIe.js.map} +1 -1
  55. package/dist/lib/{push-client-D6hbzDNV.js → push-client-DjwKknNg.js} +9 -3
  56. package/dist/lib/push-client-DjwKknNg.js.map +1 -0
  57. package/dist/lib/{shadow-claw-Cuf2O5bZ.js → shadow-claw-DcPGKenn.js} +4 -4
  58. package/dist/lib/{shadow-claw-Cuf2O5bZ.js.map → shadow-claw-DcPGKenn.js.map} +1 -1
  59. package/dist/lib/{shadow-claw-channel-config-BDPKt6Bd.js → shadow-claw-channel-config-DEL-aZ7N.js} +3 -3
  60. package/dist/lib/{shadow-claw-channel-config-BDPKt6Bd.js.map → shadow-claw-channel-config-DEL-aZ7N.js.map} +1 -1
  61. package/dist/lib/{shadow-claw-channels-BsP5JABM.js → shadow-claw-channels-BgaJiPdE.js} +2 -2
  62. package/dist/lib/{shadow-claw-channels-BsP5JABM.js.map → shadow-claw-channels-BgaJiPdE.js.map} +1 -1
  63. package/dist/lib/{shadow-claw-chat-Cam2lX4k.js → shadow-claw-chat-mXPQZbwT.js} +4 -4
  64. package/dist/lib/{shadow-claw-chat-Cam2lX4k.js.map → shadow-claw-chat-mXPQZbwT.js.map} +1 -1
  65. package/dist/lib/{shadow-claw-control-plane-DB2qcCFs.js → shadow-claw-control-plane-DO6foOLV.js} +6 -6
  66. package/dist/lib/{shadow-claw-control-plane-DB2qcCFs.js.map → shadow-claw-control-plane-DO6foOLV.js.map} +1 -1
  67. package/dist/lib/{shadow-claw-conversations-C9Vf4XGx.js → shadow-claw-conversations-BLwHTwdW.js} +2 -2
  68. package/dist/lib/{shadow-claw-conversations-C9Vf4XGx.js.map → shadow-claw-conversations-BLwHTwdW.js.map} +1 -1
  69. package/dist/lib/{shadow-claw-file-viewer-B4HYiI0v.js → shadow-claw-file-viewer-BSbZvSl-.js} +3 -3
  70. package/dist/lib/{shadow-claw-file-viewer-B4HYiI0v.js.map → shadow-claw-file-viewer-BSbZvSl-.js.map} +1 -1
  71. package/dist/lib/{shadow-claw-files-DVROUESO.js → shadow-claw-files-BLVr9Pua.js} +2 -2
  72. package/dist/lib/{shadow-claw-files-DVROUESO.js.map → shadow-claw-files-BLVr9Pua.js.map} +1 -1
  73. package/dist/lib/{shadow-claw-git-BqrO7cHJ.js → shadow-claw-git-CHC1H86J.js} +3 -3
  74. package/dist/lib/{shadow-claw-git-BqrO7cHJ.js.map → shadow-claw-git-CHC1H86J.js.map} +1 -1
  75. package/dist/lib/{shadow-claw-llm-BexUQdYo.js → shadow-claw-llm-CKXfxd3D.js} +2 -2
  76. package/dist/lib/{shadow-claw-llm-BexUQdYo.js.map → shadow-claw-llm-CKXfxd3D.js.map} +1 -1
  77. package/dist/lib/{shadow-claw-networking-CfXRGpUD.js → shadow-claw-networking-dpYvfchh.js} +2 -2
  78. package/dist/lib/{shadow-claw-networking-CfXRGpUD.js.map → shadow-claw-networking-dpYvfchh.js.map} +1 -1
  79. package/dist/lib/{shadow-claw-notifications-C9KPMgx_.js → shadow-claw-notifications-_YeAVPga.js} +2 -2
  80. package/dist/lib/{shadow-claw-notifications-C9KPMgx_.js.map → shadow-claw-notifications-_YeAVPga.js.map} +1 -1
  81. package/dist/lib/{shadow-claw-pages-CGzGXmrI.js → shadow-claw-pages-DVzZriZ7.js} +3 -3
  82. package/dist/lib/{shadow-claw-pages-CGzGXmrI.js.map → shadow-claw-pages-DVzZriZ7.js.map} +1 -1
  83. package/dist/lib/{shadow-claw-peerjs-B0ZB7yhB.js → shadow-claw-peerjs-BvixjeBz.js} +3 -3
  84. package/dist/lib/{shadow-claw-peerjs-B0ZB7yhB.js.map → shadow-claw-peerjs-BvixjeBz.js.map} +1 -1
  85. package/dist/lib/{shadow-claw-settings-DBfMZdDS.js → shadow-claw-settings-DV9-gD4Q.js} +2 -2
  86. package/dist/lib/{shadow-claw-settings-DBfMZdDS.js.map → shadow-claw-settings-DV9-gD4Q.js.map} +1 -1
  87. package/dist/lib/{shadow-claw-storage-CM-w6mgG.js → shadow-claw-storage-Bv__kXG6.js} +2 -2
  88. package/dist/lib/{shadow-claw-storage-CM-w6mgG.js.map → shadow-claw-storage-Bv__kXG6.js.map} +1 -1
  89. package/dist/lib/{shadow-claw-task-server-DV4b1g2-.js → shadow-claw-task-server-DNOe8PWK.js} +2 -2
  90. package/dist/lib/{shadow-claw-task-server-DV4b1g2-.js.map → shadow-claw-task-server-DNOe8PWK.js.map} +1 -1
  91. package/dist/lib/{shadow-claw-tasks-K-foOHSE.js → shadow-claw-tasks-qmcDT4PU.js} +3 -3
  92. package/dist/lib/{shadow-claw-tasks-K-foOHSE.js.map → shadow-claw-tasks-qmcDT4PU.js.map} +1 -1
  93. package/dist/lib/{shadow-claw-terminal-CpAknKyA.js → shadow-claw-terminal-0QUWP8of.js} +2 -2
  94. package/dist/lib/{shadow-claw-terminal-CpAknKyA.js.map → shadow-claw-terminal-0QUWP8of.js.map} +1 -1
  95. package/dist/lib/{shadow-claw-tools-D98XZ0Ep.js → shadow-claw-tools-Bs_bmI6-.js} +3 -3
  96. package/dist/lib/{shadow-claw-tools-D98XZ0Ep.js.map → shadow-claw-tools-Bs_bmI6-.js.map} +1 -1
  97. package/dist/lib/{shadow-claw-webvm-DLOb8dMI.js → shadow-claw-webvm-DYaoL7QY.js} +2 -2
  98. package/dist/lib/{shadow-claw-webvm-DLOb8dMI.js.map → shadow-claw-webvm-DYaoL7QY.js.map} +1 -1
  99. package/dist/lib/{syncWebMcpRegistration-NspKefOI.js → syncWebMcpRegistration-BhbqI6R2.js} +2 -2
  100. package/dist/lib/{syncWebMcpRegistration-NspKefOI.js.map → syncWebMcpRegistration-BhbqI6R2.js.map} +1 -1
  101. package/dist/public/.well-known/mcp/server-card.json +1 -1
  102. package/dist/public/.well-known/mcp.json +1 -1
  103. package/dist/public/AGENTS.md +22 -3
  104. package/dist/public/README.md +96 -278
  105. package/dist/public/agent.worker.js +50 -50
  106. package/dist/public/{base-task-model-CYkpwnvU-DDfHUUIS.js → base-task-model-CYkpwnvU-DrXr4G1R.js} +1 -1
  107. package/dist/public/{configurePeerJs-BhBokQlC.js → configurePeerJs-B470pdeU.js} +1 -1
  108. package/dist/public/docs/README.md +31 -31
  109. package/dist/public/docs/architecture/context-management.md +7 -0
  110. package/dist/public/docs/architecture/storage.md +10 -1
  111. package/dist/public/docs/decisions/bundled-typescript-architecture.md +0 -1
  112. package/dist/public/docs/decisions/native-web-components-and-signals.md +0 -1
  113. package/dist/public/docs/example/article/index.html +1 -1
  114. package/dist/public/docs/guides/publishing-to-github-pages.md +334 -0
  115. package/dist/public/docs/guides/server-development-configuration.md +15 -0
  116. package/dist/public/docs/publishing/index.html +1 -1
  117. package/dist/public/docs/skill-creator/index.html +1 -1
  118. package/dist/public/docs/subsystems/cli.md +10 -2
  119. package/dist/public/docs/subsystems/control-plane.md +9 -8
  120. package/dist/public/docs/subsystems/crypto.md +9 -0
  121. package/dist/public/docs/subsystems/custom-element-security.md +2 -0
  122. package/dist/public/docs/subsystems/mcp-server.md +31 -16
  123. package/dist/public/docs/subsystems/notifications.md +8 -5
  124. package/dist/public/docs/subsystems/providers.md +9 -0
  125. package/dist/public/docs/subsystems/share-target.md +107 -0
  126. package/dist/public/docs/subsystems/webmcp.md +43 -0
  127. package/dist/public/e2e/README.md +4 -2
  128. package/dist/public/{e2e-bridge-DcBoeFvd.js → e2e-bridge-CSW0S5Yz.js} +1 -1
  129. package/dist/public/{file-viewer-CKtVC9Ix.js → file-viewer-Cs-riNvy.js} +1 -1
  130. package/dist/public/{firebase-OSDX3viP.js → firebase-cwAl_ABm.js} +1 -1
  131. package/dist/public/{git-CkhCJonj.js → git-GD09WATp.js} +25 -25
  132. package/dist/public/index.html +1 -1
  133. package/dist/public/index.js +1 -1
  134. package/dist/public/{initControlPlane-Bi8ouFEb.js → initControlPlane-BqCY0NQy.js} +1 -1
  135. package/dist/public/initControlPlane-C-IXaKYX.js +1 -0
  136. package/dist/public/{language-detector-BRKrlra0.js → language-detector-CIeEuQFk.js} +1 -1
  137. package/dist/public/llms.txt +4 -2
  138. package/dist/public/main/index.html +1 -1
  139. package/dist/public/main/memory/index.html +1 -1
  140. package/dist/public/{markdown-C-hCVJtc.js → markdown-Cw7vCtTg.js} +1 -1
  141. package/dist/public/{openai-Bpd71Oja.js → openai-BJIb2c5j.js} +3 -3
  142. package/dist/public/{orchestrator-8qNGfw8r.js → orchestrator-BWkHHO9Y.js} +1 -1
  143. package/dist/public/{orchestrator-BT3Ks5ip.js → orchestrator-DpkkeD6T.js} +1 -1
  144. package/dist/public/{peerjs-DfhwEiiq.js → peerjs-tf2EmWjB.js} +1 -1
  145. package/dist/public/{prompt-api-polyfill-Dl1kbJhR.js → prompt-api-polyfill-CXd75leW.js} +1 -1
  146. package/dist/public/{push-client-BVLrE9pK.js → push-client-CHjSbrWs.js} +1 -1
  147. package/dist/public/{rewriter-j6D9LDER.js → rewriter-BEHn9gll.js} +1 -1
  148. package/dist/public/service-worker.js +1 -1
  149. package/dist/public/{shadow-claw-DCjxNDCX.js → shadow-claw-BBPV_9X8.js} +2 -2
  150. package/dist/public/{shadow-claw-channels-CITDrqMl.js → shadow-claw-channels-BJvrKQjg.js} +1 -1
  151. package/dist/public/{shadow-claw-chat-BQrSgSKF.js → shadow-claw-chat-BG2EaRaw.js} +1 -1
  152. package/dist/public/{shadow-claw-control-plane-Cp001OY0.js → shadow-claw-control-plane-BBa7WbTg.js} +2 -2
  153. package/dist/public/{shadow-claw-conversations-EhX4RvIj.js → shadow-claw-conversations-CFaWFmkm.js} +1 -1
  154. package/dist/public/{shadow-claw-file-viewer-DiQXIjZD.js → shadow-claw-file-viewer-Z-GIKaE9.js} +1 -1
  155. package/dist/public/{shadow-claw-files-lkTnSJsn.js → shadow-claw-files-BBx4iMsk.js} +1 -1
  156. package/dist/public/{shadow-claw-git-BlcA_z8x.js → shadow-claw-git-vTOKatwd.js} +2 -2
  157. package/dist/public/{shadow-claw-llm-CW16X9Rg.js → shadow-claw-llm-Ce1Ax6-x.js} +1 -1
  158. package/dist/public/{shadow-claw-networking-ySsMBY_i.js → shadow-claw-networking-q4XIzdB5.js} +1 -1
  159. package/dist/public/{shadow-claw-notifications-CyV2zCQ8.js → shadow-claw-notifications-D2cz0gmm.js} +1 -1
  160. package/dist/public/{shadow-claw-pages-Cx7cF9ah.js → shadow-claw-pages-3335lmSC.js} +1 -1
  161. package/dist/public/{shadow-claw-settings-zm4PHHGi.js → shadow-claw-settings-4ptYuJwO.js} +2 -2
  162. package/dist/public/{shadow-claw-storage-dy9JAEGd.js → shadow-claw-storage-bIrPKFhF.js} +1 -1
  163. package/dist/public/{shadow-claw-task-server-Bleww48s.js → shadow-claw-task-server-5yqVBxy1.js} +1 -1
  164. package/dist/public/{shadow-claw-tasks-CTI5oaLN.js → shadow-claw-tasks-DcqYHPLZ.js} +1 -1
  165. package/dist/public/{shadow-claw-terminal-mZ3i4HaQ.js → shadow-claw-terminal-fARaDONr.js} +1 -1
  166. package/dist/public/{shadow-claw-tools-B_nuk8Zl.js → shadow-claw-tools-paEAhcJr.js} +1 -1
  167. package/dist/public/{shadow-claw-webvm-Vl_jH5YL.js → shadow-claw-webvm-CbzH_vyX.js} +1 -1
  168. package/dist/public/{summarizer-VJNr-7xG.js → summarizer-BT3AuFed.js} +1 -1
  169. package/dist/public/{syncWebMcpRegistration-n2vAMJ4w.js → syncWebMcpRegistration-CWSYaHex.js} +1 -1
  170. package/dist/public/{transformers-BhQMWQG5.js → transformers-1VTxqKjT.js} +1 -1
  171. package/dist/public/{translator-DEQXb7ZL.js → translator-B50RYlFt.js} +1 -1
  172. package/dist/public/{webllm-CHN5H-Sy.js → webllm-FmyJWWpt.js} +1 -1
  173. package/dist/public/{writer-CD9oN2pq.js → writer-Bhb4YYRE.js} +1 -1
  174. package/dist/server.js +205 -203
  175. package/package.json +1 -1
  176. package/src/components/settings/shadow-claw-llm/shadow-claw-llm.test.ts +2 -0
  177. package/src/core/orchestrator/utils/configurePeerJs.test.ts +2 -0
  178. package/src/server/client-registry.test.ts +9 -0
  179. package/src/server/client-registry.ts +14 -0
  180. package/src/server/mcp/mcp-integration.test.ts +68 -16
  181. package/src/server/mcp/tools/built-in-tools.ts +125 -34
  182. package/src/server/mcp/tools/client-tool-relay.ts +81 -44
  183. package/src/server/mcp/tools/mcp-tools.test.ts +103 -13
  184. package/src/server/mcp/types.ts +3 -0
  185. package/src/server/openapi/paths/push.ts +48 -0
  186. package/src/server/server.ts +30 -0
  187. package/src/subsystems/notifications/push-client.test.ts +17 -0
  188. package/src/subsystems/notifications/push-client.ts +22 -2
  189. package/src/subsystems/notifications/push-routes.test.ts +31 -0
  190. package/src/subsystems/notifications/push-routes.ts +10 -0
  191. package/src/subsystems/notifications/push-store.test.ts +49 -0
  192. package/src/subsystems/notifications/push-store.ts +45 -0
  193. package/src/worker/worker.test.ts +2 -0
  194. package/dist/lib/push-client-D6hbzDNV.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{r as e}from"./config-CrHchneq.js";import{a as t,n,o as r,r as i,s as a,u as o}from"./app-routes-Bs-riIvr.js";import{n as s}from"./txPromise-EBECky1b.js";import{t as c}from"./getConfig-D89uJgo5.js";import{d as l,i as u,l as d,n as f,r as p,s as m,u as h}from"./custom-element-security-FU04Cq05.js";import{t as g}from"./dist-B9m1QM9v.js";import{a as _,c as v,gn as y,r as b,s as x,sn as S,t as C}from"./orchestrator-BT3Ks5ip.js";import{o as w,t as ee}from"./tools-DvckJZG2.js";import{t as T}from"./buffer-9oRIc-5Z.js";import{a as E,r as D,s as te}from"./toast-BXgUfbyh.js";import{t as ne}from"./shadow-claw-element-DIrv3P6A.js";import{t as O}from"./effect-BJCrpFdp.js";import{t as re}from"./config-value-oBfKgLT4.js";import"./shadow-claw-page-header-action-button-Bmua3mAb.js";import"./shadow-claw-page-header-BccSHItx.js";import{n as k,t as ie}from"./markdown-C-hCVJtc.js";import{t as ae}from"./file-viewer-CKtVC9Ix.js";import{a as A,c as oe,i as se,n as ce,o as le,r as ue,s as de,t as fe}from"./iframe-storage-proxy-B9Zt-vJ2.js";function pe(e,t,n){n&&(n.textContent=`Navigated to page: ${t||e.path}`)}function j(e,t){if(e===t||e===`main`&&t===`br:main`||e===`br:main`&&t===`main`)return!0;if(!e.includes(`:`)&&!t.includes(`:`))return!1;let n=e=>e.trim().replace(/:/g,`-`);return n(e)===n(t)}function M(e,i,a,s=typeof window<`u`?window.location.origin:``){let c=e.trim();if(!c||c.startsWith(`#`))return null;let l=c.split(/[?#]/,1)[0],u=l.replace(/^(?:\.\/)+/u,``),d=[];if(u.startsWith(`files/`)&&d.push(`/${u}`),l.startsWith(`/`)){let e=l.lastIndexOf(`/files/`);e>0&&d.push(l.slice(e)),d.push(l)}for(let e of d){let t=r(e);if(t&&j(t.groupId,a))return t.path}let f=o(c,n(t(a,i)),s||(typeof window<`u`?window.location.origin:``));if(!f||s&&f.origin!==s)return null;let p=r(f.pathname);return!p||!j(p.groupId,a)?null:p.path}function N(e,t,n,r,i=typeof window<`u`?window.location.origin:``){if(!e)return e;let s=i||(typeof window<`u`?window.location.origin:``),c=new DOMParser().parseFromString(e,`text/html`),l=(e,i)=>{let l=Array.from(c.querySelectorAll(e));for(let e of l){let c=(e.getAttribute(i)||``).trim();if(!c||c.startsWith(`#`)||c.startsWith(`javascript:`))continue;let l=o(c,n,s);!l||s&&l.origin!==s||i===`href`&&!(a(l.pathname)||M(c,t,r,s))||e.setAttribute(i,`${l.pathname}${l.search}${l.hash}`)}};return l(`a[href]`,`href`),l(`img[src]`,`src`),l(`audio[src]`,`src`),l(`video[src]`,`src`),l(`source[src]`,`src`),c.body.innerHTML}const me={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|file|blob|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`,`figure`,`figcaption`],CUSTOM_ELEMENT_HANDLING:{tagNameCheck:e=>m(e),attributeNameCheck:()=>!0,allowCustomizedBuiltInElements:!1},ADD_ATTR:[`allow`,`allowfullscreen`,`frameborder`,`scrolling`,`referrerpolicy`,`loading`]};async function he({content:e,filePath:r,searchParams:i=``,groupId:a,origin:o=typeof window<`u`?window.location?.origin:``,sanitizeOptions:s=me,resolveRelativeImagesInHtmlFn:c}){let l=n(t(a,r)),u=N(e,r,l,a,o),m=d(c?await c(u,r,a):u,s),h=crypto.randomUUID().replace(/-/g,``),g=n(`/assets/file-viewer-preview-bridge.js`),_=n(`/assets/iframe-storage-bridge.js`),v=f(),y=p(h),b=typeof document<`u`?document.getElementById(`shadow-claw-site-config`):null,x=b&&b.textContent?`<script id="shadow-claw-site-config" type="application/json">${b.textContent}<\/script>`:``,S=i?`<script nonce="${h}">(function(){try{Object.defineProperty(globalThis.location,"search",{get:function(){return ${JSON.stringify(i)};},configurable:true});}catch(e){}})();<\/script>`:``,C=v.map(({src:e,hasInit:t})=>{let r=e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)?e:n(e.startsWith(`/`)?e:`/${e.replace(/^pages\/main\//,``)}`),i=[`<script type="module" src="${r}" nonce="${h}"><\/script>`];return t&&i.push(`<script type="module" nonce="${h}">import("${r}").then((m) => { try { if (typeof m?.init === "function") m.init(); } catch (e) { console.error("[ShadowClaw] Error executing init for " + ${JSON.stringify(r)}, e); } }).catch(() => {});<\/script>`),i.join(`
1
+ import{r as e}from"./config-CrHchneq.js";import{a as t,n,o as r,r as i,s as a,u as o}from"./app-routes-Bs-riIvr.js";import{n as s}from"./txPromise-EBECky1b.js";import{t as c}from"./getConfig-D89uJgo5.js";import{d as l,i as u,l as d,n as f,r as p,s as m,u as h}from"./custom-element-security-FU04Cq05.js";import{t as g}from"./dist-B9m1QM9v.js";import{a as _,c as v,gn as y,r as b,s as x,sn as S,t as C}from"./orchestrator-DpkkeD6T.js";import{o as w,t as ee}from"./tools-DvckJZG2.js";import{t as T}from"./buffer-9oRIc-5Z.js";import{a as E,r as D,s as te}from"./toast-BXgUfbyh.js";import{t as ne}from"./shadow-claw-element-DIrv3P6A.js";import{t as O}from"./effect-BJCrpFdp.js";import{t as re}from"./config-value-oBfKgLT4.js";import"./shadow-claw-page-header-action-button-Bmua3mAb.js";import"./shadow-claw-page-header-BccSHItx.js";import{n as k,t as ie}from"./markdown-Cw7vCtTg.js";import{t as ae}from"./file-viewer-Cs-riNvy.js";import{a as A,c as oe,i as se,n as ce,o as le,r as ue,s as de,t as fe}from"./iframe-storage-proxy-B9Zt-vJ2.js";function pe(e,t,n){n&&(n.textContent=`Navigated to page: ${t||e.path}`)}function j(e,t){if(e===t||e===`main`&&t===`br:main`||e===`br:main`&&t===`main`)return!0;if(!e.includes(`:`)&&!t.includes(`:`))return!1;let n=e=>e.trim().replace(/:/g,`-`);return n(e)===n(t)}function M(e,i,a,s=typeof window<`u`?window.location.origin:``){let c=e.trim();if(!c||c.startsWith(`#`))return null;let l=c.split(/[?#]/,1)[0],u=l.replace(/^(?:\.\/)+/u,``),d=[];if(u.startsWith(`files/`)&&d.push(`/${u}`),l.startsWith(`/`)){let e=l.lastIndexOf(`/files/`);e>0&&d.push(l.slice(e)),d.push(l)}for(let e of d){let t=r(e);if(t&&j(t.groupId,a))return t.path}let f=o(c,n(t(a,i)),s||(typeof window<`u`?window.location.origin:``));if(!f||s&&f.origin!==s)return null;let p=r(f.pathname);return!p||!j(p.groupId,a)?null:p.path}function N(e,t,n,r,i=typeof window<`u`?window.location.origin:``){if(!e)return e;let s=i||(typeof window<`u`?window.location.origin:``),c=new DOMParser().parseFromString(e,`text/html`),l=(e,i)=>{let l=Array.from(c.querySelectorAll(e));for(let e of l){let c=(e.getAttribute(i)||``).trim();if(!c||c.startsWith(`#`)||c.startsWith(`javascript:`))continue;let l=o(c,n,s);!l||s&&l.origin!==s||i===`href`&&!(a(l.pathname)||M(c,t,r,s))||e.setAttribute(i,`${l.pathname}${l.search}${l.hash}`)}};return l(`a[href]`,`href`),l(`img[src]`,`src`),l(`audio[src]`,`src`),l(`video[src]`,`src`),l(`source[src]`,`src`),c.body.innerHTML}const me={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|file|blob|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`,`figure`,`figcaption`],CUSTOM_ELEMENT_HANDLING:{tagNameCheck:e=>m(e),attributeNameCheck:()=>!0,allowCustomizedBuiltInElements:!1},ADD_ATTR:[`allow`,`allowfullscreen`,`frameborder`,`scrolling`,`referrerpolicy`,`loading`]};async function he({content:e,filePath:r,searchParams:i=``,groupId:a,origin:o=typeof window<`u`?window.location?.origin:``,sanitizeOptions:s=me,resolveRelativeImagesInHtmlFn:c}){let l=n(t(a,r)),u=N(e,r,l,a,o),m=d(c?await c(u,r,a):u,s),h=crypto.randomUUID().replace(/-/g,``),g=n(`/assets/file-viewer-preview-bridge.js`),_=n(`/assets/iframe-storage-bridge.js`),v=f(),y=p(h),b=typeof document<`u`?document.getElementById(`shadow-claw-site-config`):null,x=b&&b.textContent?`<script id="shadow-claw-site-config" type="application/json">${b.textContent}<\/script>`:``,S=i?`<script nonce="${h}">(function(){try{Object.defineProperty(globalThis.location,"search",{get:function(){return ${JSON.stringify(i)};},configurable:true});}catch(e){}})();<\/script>`:``,C=v.map(({src:e,hasInit:t})=>{let r=e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`//`)?e:n(e.startsWith(`/`)?e:`/${e.replace(/^pages\/main\//,``)}`),i=[`<script type="module" src="${r}" nonce="${h}"><\/script>`];return t&&i.push(`<script type="module" nonce="${h}">import("${r}").then((m) => { try { if (typeof m?.init === "function") m.init(); } catch (e) { console.error("[ShadowClaw] Error executing init for " + ${JSON.stringify(r)}, e); } }).catch(() => {});<\/script>`),i.join(`
2
2
  `)}).join(`
3
3
  `),w=`<link rel="stylesheet" href="${n(`/theme.css`)}">`;return[`<!doctype html>`,`<html class="${de()}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">`,`<meta http-equiv="Content-Security-Policy" content="${y}">`,`<base href="${l}" target="_blank">`,S,x,`<script src="${_}" nonce="${h}"><\/script>`,`<script src="${g}" nonce="${h}"><\/script>`,oe(),w,C,`</head><body>`,m,`</body></html>`].join(``)}function ge(e,t){return t===0?{isPrevDisabled:!0,isNextDisabled:!0}:{isPrevDisabled:e<=0,isNextDisabled:e<0||e>=t-1}}async function _e(e,t,n=e=>C.removeAllPages(e)){return!e||!await t({title:`Remove All Pages`,message:`Remove ALL saved pages from Pages? This cannot be undone!`,confirmLabel:`Remove All`,cancelLabel:`Cancel`})?!1:(await n(e),!0)}const P={setItem:A,deleteItem:ce,clear:fe,getAll:se,getItem:ue,putItem:A};async function F(e,t,n,r=P){switch(e){case`setItem`:await r.setItem(n,String(t.key||``),t.value);return;case`removeItem`:await r.deleteItem(n,String(t.key||``));return;case`clear`:await r.clear(n);return;case`getAllItems`:return await r.getAll(n);case`idb-get`:return await r.getItem(`${n}::idb::${t.dbName}::${t.storeName}`,String(t.key||``));case`idb-getAll`:return await r.getAll(`${n}::idb::${t.dbName}::${t.storeName}`);case`idb-put`:{let e=t.key==null?`__auto_${Date.now()}`:String(t.key);return await r.putItem(`${n}::idb::${t.dbName}::${t.storeName}`,e,t.value),e}case`idb-delete`:await r.deleteItem(`${n}::idb::${t.dbName}::${t.storeName}`,String(t.key||``));return;case`idb-clear`:await r.clear(`${n}::idb::${t.dbName}::${t.storeName}`);return;case`idb-deleteDatabase`:await r.clear(`${n}::idb::${t.dbName}::__default__`);return;case`idb-count`:{let e=await r.getAll(`${n}::idb::${t.dbName}::${t.storeName}`);return Object.keys(e).length}default:throw Error(`Unknown storage proxy method: ${e}`)}}async function I(e,t,n,r,i,a=P){if(t)try{let o=await F(n,r,i,a);e.postMessage({type:`shadow-claw-storage-proxy-result`,requestId:t,result:o??null},`*`)}catch(n){e.postMessage({type:`shadow-claw-storage-proxy-result`,requestId:t,error:n instanceof Error?n.message:String(n)},`*`)}}function ve({root:e,rendered:t,selectedPath:n,onIframeLoad:r}){let i=e.querySelector(`[data-pages-iframe]`);if(i instanceof HTMLIFrameElement)return i;let a=document.createElement(`iframe`);return a.className=`pages__iframe`,a.setAttribute(`data-pages-iframe`,``),a.setAttribute(`title`,n?`Preview: ${n}`:`Page preview`),a.setAttribute(`sandbox`,u()),a.setAttribute(`allow`,`fullscreen`),a.hidden=!0,r&&a.addEventListener(`load`,()=>{r(a.contentWindow)}),t.before(a),a}function L(e){if(typeof e==`string`||typeof e==`number`){let t=parseInt(String(e),10);if(!isNaN(t)&&t>=0)return Math.min(t,86400)}return 0}async function ye(t,n=c){if(!t)return 0;try{return L(await n(t,e.PAGES_AUTO_REFRESH_INTERVAL))}catch{return 0}}function R(e){if(!e)return``;let t=e.groupId;return t===`main`&&(t=`br:main`),`${t}\u0000${e.path}`}function z(e,t=[]){if(!e)return-1;let n=R(e);return t.findIndex(e=>R(e)===n)}function be(e=[]){let t=new Map;return e.forEach(e=>{let n=t.get(e.groupId)||[];n.push(e),t.set(e.groupId,n)}),t}function xe(e,t){if(!t||t.hidden)return!1;let n=e.replace(/^#/,``),r=t.querySelector(`[id="${n}"]`)||t.querySelector(`a[name="${n}"]`);return r?(r.scrollIntoView({behavior:`smooth`,block:`start`}),!0):!1}function Se(e){let t=e.detail;return t&&t.interval!==void 0?L(t.interval):null}function Ce(e,t){return!e||!t||!e.groupId||!e.path||e.path!==t.path?!1:e.groupId===t.groupId||j(e.groupId,t.groupId)}function we(e,t){let n=e.detail;return Ce(n,t)}function B(e,t){let n=[`data-no-nav`,`data-no-swipe`,`data-no-page-nav`,`data-prevent-nav`,`data-prevent-page-nav`,`data-isolate-input`,`data-isolate-navigation`,`data-game-controls`],r=e=>{if(!e||!(e instanceof HTMLElement))return!1;let t=e.tagName.toLowerCase();return!!(t===`input`||t===`textarea`||t===`select`||t===`option`||t===`iframe`||e.classList.contains(`pages__preview-frame`)||e.isContentEditable||e.contentEditable===`true`||e.getAttribute(`contenteditable`)===`true`||e.hasAttribute(`contenteditable`)||e.closest(`[data-pages-list]`)||e.closest(`[data-pages-dropdown]`)||e.closest(`.pages__sidebar`)||e.closest(`.pages__preview-frame`)||e.closest(`iframe`)||n.some(t=>e.closest(`[${t}]`)))};if(t&&r(t))return!0;if(e){let t=typeof e.composedPath==`function`?e.composedPath():[];for(let e of t)if(e instanceof HTMLElement){let t=e.tagName.toLowerCase();if(n.some(t=>e.hasAttribute(t))||t===`input`||t===`textarea`||t===`select`||t===`option`||t===`iframe`||e.classList.contains(`pages__preview-frame`)||e.isContentEditable||e.contentEditable===`true`||e.getAttribute(`contenteditable`)===`true`||e.hasAttribute(`contenteditable`))return!0}if(e.target&&r(e.target))return!0}return!1}function Te(e,t){return t||e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.ctrlKey||e.altKey||e.metaKey?null:e.key===`ArrowLeft`?`previous`:`next`}function Ee(e,t,n,r){if(!t)return;let i=n?.activeElement||document.activeElement,a=Te(e,B(e,e.target||null)||B(void 0,i));a&&(e.preventDefault(),r(a))}function De(e,t,n=Date.now()){return e.button!==0||t?{mouseStartX:0,mouseStartY:0,mouseStartTime:0,isMouseDown:!1}:{mouseStartX:e.clientX,mouseStartY:e.clientY,mouseStartTime:n,isMouseDown:!0}}function V(e,t,n,r,i,a=Date.now(),o=50,s=600){let c=n-e,l=r-t,u=a-i;return Math.abs(c)>=o&&Math.abs(c)>Math.abs(l)&&u<=s?c<0?`next`:`previous`:null}function Oe(e,t,n,r,i=Date.now()){return!t.isMouseDown||n||r?null:V(t.mouseStartX,t.mouseStartY,e.clientX,e.clientY,t.mouseStartTime,i)}function ke(e,t,n){if(t===n||t<0||t>=e.length||n<0||n>=e.length)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}async function Ae({db:e,currentPages:t,fromIndex:n,toIndex:r,reorderStoreFn:i=(e,t)=>C.reorderPages(e,t)}){if(!e||n===r)return{reordered:!1,reorderedPages:t,movedToFirst:null};let a=ke(t,n,r);if(a===t)return{reordered:!1,reorderedPages:t,movedToFirst:null};await i(e,a);let o=a[r]||null;return{reordered:!0,reorderedPages:a,movedToFirst:r===0?o:null}}function je(e,t,n,r=Date.now()){if(!t.touchStartTime||n)return null;if(e.changedTouches&&e.changedTouches.length===1){let n=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY;return V(t.touchStartX,t.touchStartY,n,i,t.touchStartTime,r)}return null}function Me(e,t,n=Date.now()){return t?{touchStartX:0,touchStartY:0,touchStartTime:0}:e.touches&&e.touches.length===1?{touchStartX:e.touches[0].clientX,touchStartY:e.touches[0].clientY,touchStartTime:n}:null}function Ne(e,t,n){return!e&&t?`render-and-timer`:e&&n?`clear-timer`:`noop`}function Pe(e,t){return!e&&t}function Fe(e){return/\.(html?|xhtml)$/iu.test(e)}function Ie(e){return/\.(md|markdown)$/iu.test(e)}function Le(e){if(!e||typeof e!=`object`)return null;let t=e;return t.type===`shadow-claw-broadcast-result`&&typeof t.channel==`string`?{kind:`broadcast-result`,channel:t.channel,payload:t.payload}:t.type===`shadow-claw-storage-proxy`?{kind:`storage-proxy`,requestId:String(t.requestId||``),method:String(t.method||``),args:t.args&&typeof t.args==`object`?t.args:{}}:t.type===`shadow-claw-swipe`&&typeof t.direction==`string`?{kind:`swipe`,direction:t.direction}:t.type===`shadow-claw-iframe-resize`&&typeof t.height==`number`?{kind:`iframe-resize`,height:t.height}:t.type===`shadow-claw-file-viewer-link`&&typeof t.href==`string`?{kind:`file-viewer-link`,href:t.href}:null}var H=T();function U(e){return{apng:`image/apng`,avif:`image/avif`,gif:`image/gif`,jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`,webp:`image/webp`}[e]??`image/jpeg`}async function Re({db:e,groupId:t,workspacePath:r,readGroupFileBytesFn:i=y,writeGroupFileFn:a=S,fetchFn:o=typeof fetch<`u`?fetch:void 0}){if(e)try{let n=await i(e,t,r),a=U(r.split(`.`).pop()?.toLowerCase()||``),o=new Uint8Array(n.byteLength);return o.set(new Uint8Array(n)),`data:${a};base64,${H.Buffer.from(o).toString(`base64`)}`}catch{}if(!o)return null;try{let i=r.replace(/^\/+/,``),s=[n(`/files/main/${i}`),n(`/static-main/${i}`),n(`/pages/main/${i}`)];for(let n of s)try{let i=await o(typeof window<`u`&&window.location?.origin?new URL(n,window.location.origin).toString():n);if(i.ok){let n=await i.blob();if(e)try{let i=await n.arrayBuffer();await a(e,t,r,new Uint8Array(i))}catch{}if(typeof FileReader<`u`)return await new Promise((e,t)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=t,r.readAsDataURL(n)});let o=await n.arrayBuffer(),s=H.Buffer.from(o).toString(`base64`);return`data:${n.type||U(r.split(`.`).pop()||``)};base64,${s}`}}catch{}}catch{}return null}function W(e){let t=e.querySelector(`[data-pages-iframe]`);t instanceof HTMLIFrameElement&&(t.removeAttribute(`srcdoc`),t.remove())}async function G(e,t=typeof document<`u`?document.querySelector(`shadow-claw`):null,n=te){return t&&typeof t.requestDialog==`function`?await t.requestDialog({mode:`confirm`,...e}):(n(e.message,4500),!1)}async function ze(e,t,n=c){if(!e||typeof e.transaction!=`function`)return!0;try{return re(await n(e,t),!0)}catch{return!0}}function Be(e,t,n=[]){if(e===t||j(e,t))return t;let r=n.find(t=>t.groupId===e);if(r)return r.groupId;let i=n.find(t=>j(e,t.groupId));return i?i.groupId:e||null}function Ve(e,t,n,i=[],a=typeof window<`u`?window.location.origin:``){let o=e.trim();if(!o||o.startsWith(`#`))return null;let s=[],c=o.split(/[?#]/,1)[0];if(/^[a-zA-Z][a-zA-Z\d+.-]*:/u.test(c)||c.startsWith(`//`)){let e;try{e=new URL(c,a||(typeof window<`u`?window.location.origin:``))}catch{return null}if(a&&e.origin!==a)return null;c=e.pathname}let l=c.replace(/^(?:\.\/)+/u,``);if(l.startsWith(`files/`)&&s.push(`/${l}`),c.startsWith(`/`)){let e=c.lastIndexOf(`/files/`);e>0&&s.push(c.slice(e)),s.push(c)}for(let e of s){let t=r(e);if(!t)continue;let a=Be(t.groupId,n,i);if(a)return{groupId:a,path:t.path}}let u=M(o,t,n,a);return u?{groupId:n,path:u}:null}async function He({container:e,groupId:t,filePath:n,groups:r,readImageAsDataUrlFn:i}){let a=Array.from(e.querySelectorAll(`img[src]`));a.length!==0&&await Promise.all(a.map(async e=>{let a=e.getAttribute(`src`)||``;if(!a||/^(?:blob:|data:|#)/u.test(a))return;let o=Ve(a,n,t,r);if(!o)return;let s=await i(o.groupId,o.path);s&&e.setAttribute(`src`,s)}))}function K(e,t,n){return e>0&&!t&&n}function Ue(e){if(!e)return;let t=typeof document<`u`&&document.documentElement.classList.contains(`dark-mode`),n={};if(typeof document<`u`&&typeof getComputedStyle<`u`){let e=getComputedStyle(document.documentElement);for(let t=0;t<e.length;t++){let r=e[t];r.startsWith(`--`)&&(n[r]=e.getPropertyValue(r))}}e.postMessage({type:`shadow-claw-theme-update`,theme:t?`dark`:`light`,customProperties:n},`*`)}function q({root:e,currentOpen:t,force:n}){if(!e)return t;let r=e.querySelector(`[data-pages-dropdown]`),i=r instanceof HTMLDetailsElement&&r.open,a;a=n===void 0?!(i||t):n;let o=e.querySelector(`.pages__sidebar`),s=e.querySelector(`.pages__content`);return o&&o.classList.toggle(`collapsed`,!a),s&&s.classList.toggle(`pages__content--sidebar-collapsed`,!a),r instanceof HTMLDetailsElement&&(a?r.setAttribute(`open`,``):r.removeAttribute(`open`)),a}const J=new CSSStyleSheet;J.replaceSync(`* {
4
4
  box-sizing: border-box;
@@ -1,4 +1,4 @@
1
- import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b.js";import{h as n}from"./custom-element-security-FU04Cq05.js";import{Z as r,a as i,c as a,ln as o,t as s}from"./orchestrator-BT3Ks5ip.js";import{n as c,r as l}from"./crypto-C8c5wMzN.js";import{a as u,i as d,r as f}from"./toast-BXgUfbyh.js";import{t as p}from"./shadow-claw-element-DIrv3P6A.js";import{t as m}from"./config-value-oBfKgLT4.js";import"./shadow-claw-page-header-BccSHItx.js";import"./shadow-claw-dialog-BrOwAOdk.js";function h(e){try{return JSON.parse(JSON.stringify(e))}catch{return null}}async function g(t,n){let r=[],i=[];for(let a of t){let t=a.key;if(t===e.STORAGE_HANDLE)continue;if(t===e.GIT_PASSWORD||t===e.API_KEY||t.startsWith(`api_key:`)||t===e.IMESSAGE_API_KEY||t===e.TELEGRAM_BOT_TOKEN){if(n&&typeof a.value==`string`){let e=await c(a.value);e&&i.push({key:t,path:[],value:e})}continue}let o=h(a.value);if(t===e.GIT_ACCOUNTS&&Array.isArray(o))for(let e=0;e<o.length;e+=1){let r=o[e];if(!r||typeof r!=`object`)continue;let a=r.password;if(typeof a==`string`&&a){if(n){let n=await c(a);n&&i.push({key:t,path:[e,`password`],value:n})}delete r.password}}if(t===e.INTEGRATION_CONNECTIONS&&Array.isArray(o))for(let e=0;e<o.length;e+=1){let r=o[e]?.credentialRef,a=r?.encryptedSecret;if(typeof a==`string`&&a){if(n){let n=await c(a);n&&i.push({key:t,path:[e,`credentialRef`,`encryptedSecret`],value:n})}delete r.encryptedSecret}}if(t===e.REMOTE_MCP_CONNECTIONS&&Array.isArray(o))for(let e=0;e<o.length;e+=1){let r=o[e]?.credentialRef,a=r?.encryptedValue;if(typeof a==`string`&&a){if(n){let n=await c(a);n&&i.push({key:t,path:[e,`credentialRef`,`encryptedValue`],value:n})}delete r.encryptedValue}}r.push({key:t,value:o})}return{configEntries:r,plaintextPasswords:i}}function _(e,t,n){if(t.length===0)return n;let r=e;for(let n=0;n<t.length-1;n+=1){let i=t[n];if(typeof i==`number`){if(!Array.isArray(r)||!r[i])return e;r=r[i]}else{if(!r||typeof r!=`object`)return e;let t=r[i];if(!t||typeof t!=`object`)return e;r=t}}let i=t[t.length-1];if(typeof i==`number`){if(!Array.isArray(r))return e;r[i]=n}else{if(!r||typeof r!=`object`)return e;r[i]=n}return e}async function v(e,t){let n=await g(e,t);return{kind:`shadowclaw-settings-backup`,version:1,exportedAt:Date.now(),includePlaintextPasswords:t,configEntries:n.configEntries,plaintextPasswords:t?n.plaintextPasswords:void 0}}async function y(e,t){let n=await v(e,t);return new Blob([JSON.stringify(n,null,2)],{type:`application/json`})}async function b(e,t,n){let r=await v(t,n);await o(e,JSON.stringify(r,null,2))}async function x(e,t){if(!t.length)return e;let n=e.map(e=>({key:e.key,value:h(e.value)}));for(let e of t){let t=await l(e.value);if(!t)continue;let r=n.find(t=>t.key===e.key);r?r.value=_(r.value,e.path,t):e.path.length===0&&n.push({key:e.key,value:t})}return n}function S(e){let t=JSON.parse(e);if(t?.kind!==`shadowclaw-settings-backup`||t.version!==1||!Array.isArray(t.configEntries))throw Error(`Invalid settings backup file`);let n=Array.isArray(t.plaintextPasswords)?t.plaintextPasswords.filter(e=>e&&typeof e.key==`string`&&Array.isArray(e.path)&&typeof e.value==`string`):[];return{kind:`shadowclaw-settings-backup`,version:1,exportedAt:typeof t.exportedAt==`number`?t.exportedAt:Date.now(),includePlaintextPasswords:!!t.includePlaintextPasswords,configEntries:t.configEntries.filter(e=>e&&typeof e.key==`string`).map(e=>({key:e.key,value:e.value})),plaintextPasswords:n}}const C=new CSSStyleSheet;C.replaceSync(`*,
1
+ import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b.js";import{h as n}from"./custom-element-security-FU04Cq05.js";import{Z as r,a as i,c as a,ln as o,t as s}from"./orchestrator-DpkkeD6T.js";import{n as c,r as l}from"./crypto-C8c5wMzN.js";import{a as u,i as d,r as f}from"./toast-BXgUfbyh.js";import{t as p}from"./shadow-claw-element-DIrv3P6A.js";import{t as m}from"./config-value-oBfKgLT4.js";import"./shadow-claw-page-header-BccSHItx.js";import"./shadow-claw-dialog-BrOwAOdk.js";function h(e){try{return JSON.parse(JSON.stringify(e))}catch{return null}}async function g(t,n){let r=[],i=[];for(let a of t){let t=a.key;if(t===e.STORAGE_HANDLE)continue;if(t===e.GIT_PASSWORD||t===e.API_KEY||t.startsWith(`api_key:`)||t===e.IMESSAGE_API_KEY||t===e.TELEGRAM_BOT_TOKEN){if(n&&typeof a.value==`string`){let e=await c(a.value);e&&i.push({key:t,path:[],value:e})}continue}let o=h(a.value);if(t===e.GIT_ACCOUNTS&&Array.isArray(o))for(let e=0;e<o.length;e+=1){let r=o[e];if(!r||typeof r!=`object`)continue;let a=r.password;if(typeof a==`string`&&a){if(n){let n=await c(a);n&&i.push({key:t,path:[e,`password`],value:n})}delete r.password}}if(t===e.INTEGRATION_CONNECTIONS&&Array.isArray(o))for(let e=0;e<o.length;e+=1){let r=o[e]?.credentialRef,a=r?.encryptedSecret;if(typeof a==`string`&&a){if(n){let n=await c(a);n&&i.push({key:t,path:[e,`credentialRef`,`encryptedSecret`],value:n})}delete r.encryptedSecret}}if(t===e.REMOTE_MCP_CONNECTIONS&&Array.isArray(o))for(let e=0;e<o.length;e+=1){let r=o[e]?.credentialRef,a=r?.encryptedValue;if(typeof a==`string`&&a){if(n){let n=await c(a);n&&i.push({key:t,path:[e,`credentialRef`,`encryptedValue`],value:n})}delete r.encryptedValue}}r.push({key:t,value:o})}return{configEntries:r,plaintextPasswords:i}}function _(e,t,n){if(t.length===0)return n;let r=e;for(let n=0;n<t.length-1;n+=1){let i=t[n];if(typeof i==`number`){if(!Array.isArray(r)||!r[i])return e;r=r[i]}else{if(!r||typeof r!=`object`)return e;let t=r[i];if(!t||typeof t!=`object`)return e;r=t}}let i=t[t.length-1];if(typeof i==`number`){if(!Array.isArray(r))return e;r[i]=n}else{if(!r||typeof r!=`object`)return e;r[i]=n}return e}async function v(e,t){let n=await g(e,t);return{kind:`shadowclaw-settings-backup`,version:1,exportedAt:Date.now(),includePlaintextPasswords:t,configEntries:n.configEntries,plaintextPasswords:t?n.plaintextPasswords:void 0}}async function y(e,t){let n=await v(e,t);return new Blob([JSON.stringify(n,null,2)],{type:`application/json`})}async function b(e,t,n){let r=await v(t,n);await o(e,JSON.stringify(r,null,2))}async function x(e,t){if(!t.length)return e;let n=e.map(e=>({key:e.key,value:h(e.value)}));for(let e of t){let t=await l(e.value);if(!t)continue;let r=n.find(t=>t.key===e.key);r?r.value=_(r.value,e.path,t):e.path.length===0&&n.push({key:e.key,value:t})}return n}function S(e){let t=JSON.parse(e);if(t?.kind!==`shadowclaw-settings-backup`||t.version!==1||!Array.isArray(t.configEntries))throw Error(`Invalid settings backup file`);let n=Array.isArray(t.plaintextPasswords)?t.plaintextPasswords.filter(e=>e&&typeof e.key==`string`&&Array.isArray(e.path)&&typeof e.value==`string`):[];return{kind:`shadowclaw-settings-backup`,version:1,exportedAt:typeof t.exportedAt==`number`?t.exportedAt:Date.now(),includePlaintextPasswords:!!t.includePlaintextPasswords,configEntries:t.configEntries.filter(e=>e&&typeof e.key==`string`).map(e=>({key:e.key,value:e.value})),plaintextPasswords:n}}const C=new CSSStyleSheet;C.replaceSync(`*,
2
2
  *::before,
3
3
  *::after {
4
4
  font-family: var(--shadow-claw-font-sans);
@@ -885,7 +885,7 @@ import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b
885
885
  </div>
886
886
  </div>
887
887
  </template>
888
- `,`text/html`),T=w.querySelector(`template`);let E=[];E=T?Array.from(T.content.children):Array.from(w.head.children).concat(Array.from(w.body.children));var D=E;const O={ai:[()=>import(`./shadow-claw-llm-CW16X9Rg.js`)],environment:[()=>import(`./shadow-claw-networking-ySsMBY_i.js`),()=>import(`./shadow-claw-webvm-Vl_jH5YL.js`),()=>import(`./shadow-claw-storage-dy9JAEGd.js`)],integrations:[()=>import(`./shadow-claw-git-BlcA_z8x.js`),()=>import(`./shadow-claw-accounts-xUOLBsQZ.js`),()=>import(`./shadow-claw-mcp-remote-Bkx0gsmF.js`),()=>import(`./shadow-claw-control-plane-Cp001OY0.js`),()=>import(`./shadow-claw-integrations-BBVnO0Fc.js`),()=>import(`./shadow-claw-task-server-Bleww48s.js`),()=>import(`./shadow-claw-notifications-CyV2zCQ8.js`)]},k=new Set;async function A(e){if(k.has(e))return;let t=O[e];t&&(k.add(e),await Promise.all(t.map(e=>e())))}const j=`shadow-claw-settings`;var M=class extends p{static styles=C;static template=D;activeTab=`ai`;db=null;orchestrator=null;pendingRestoreFile=null;constructor(){super()}async connectedCallback(){if(!this.shadowRoot)throw Error(`shadowRoot not found`);this.db=await t(),this.orchestrator=s.orchestrator,await this.render()}activateTab(e){!e||this.activeTab===e||(this.activeTab=e,this.applyTabState())}applyTabState(){A(this.activeTab).catch(console.error);let e=this.shadowRoot;e&&(e.querySelectorAll(`[data-tab-target]`).forEach(e=>{let t=e.dataset.tabTarget===this.activeTab;e.classList.toggle(`active`,t),e.setAttribute(`aria-selected`,String(t)),e.tabIndex=t?0:-1}),e.querySelectorAll(`[data-tab-panel]`).forEach(e=>{e.hidden=e.dataset.tabPanel!==this.activeTab}))}bindSettingsActions(){let e=this.shadowRoot;if(!e)return;e.querySelector(`[data-action="backup-settings"]`)?.addEventListener(`click`,()=>this.openBackupDialog());let t=e.querySelector(`.settings__restore-input`);e.querySelector(`[data-action="restore-settings"]`)?.addEventListener(`click`,()=>{t instanceof HTMLInputElement&&(t.value=``,t.click())}),t?.addEventListener(`change`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.files?.[0]||null;n&&(this.pendingRestoreFile=n,this.openRestoreDialog(n.name))}),e.querySelector(`[data-action="clear-settings"]`)?.addEventListener(`click`,()=>this.openClearDialog()),e.querySelector(`[data-action="cancel-backup-settings"]`)?.addEventListener(`click`,()=>this.closeDialog(`.settings__backup-dialog`)),e.querySelector(`[data-action="confirm-backup-settings"]`)?.addEventListener(`click`,()=>{this.confirmBackup()}),e.querySelector(`[data-action="cancel-restore-settings"]`)?.addEventListener(`click`,()=>{this.pendingRestoreFile=null,this.closeDialog(`.settings__restore-dialog`)}),e.querySelector(`[data-action="confirm-restore-settings"]`)?.addEventListener(`click`,()=>{this.confirmRestore()}),e.querySelector(`[data-action="cancel-clear-settings"]`)?.addEventListener(`click`,()=>this.closeDialog(`.settings__clear-dialog`)),e.querySelector(`[data-action="confirm-clear-settings"]`)?.addEventListener(`click`,()=>{this.confirmClear()}),e.querySelector(`[data-action="save-assistant-name"]`)?.addEventListener(`click`,()=>this.saveAssistantName()),e.querySelector(`[data-setting="activity-log-disk-logging-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onActivityLogDiskLoggingToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-pages-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHidePagesToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-chat-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHideChatToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-tasks-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHideTasksToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-files-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHideFilesToggle(t.checked)}),e.querySelector(`[data-setting="chat-split-view-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onChatSplitViewToggle(t.checked)}),e.querySelector(`[data-setting="pages-auto-refresh-input"]`)?.addEventListener(`change`,e=>{let t=e.target;if(t){let e=parseInt(t.value,10);this.onPagesAutoRefreshInputChange(isNaN(e)?0:e)}}),e.querySelector(`[data-setting="override-prerender-skeleton-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onOverridePrerenderSkeletonToggle(t.checked)}),e.querySelector(`[data-action="save-dom-allowed-iframe-hosts"]`)?.addEventListener(`click`,()=>{this.saveDomAllowedIframeHosts()})}closeDialog(e){this.getDialog(e)?.close()}getDialog(e){let t=this.shadowRoot;if(!t)return null;let n=t.querySelector(e);return n instanceof HTMLDialogElement?n:null}handleTabKeydown(e,t){let n=this.shadowRoot;if(!n)return;let r=Array.from(n.querySelectorAll(`[data-tab-target]`)),i=r.indexOf(t);if(i<0)return;let a=-1;switch(e.key){case`ArrowRight`:case`ArrowDown`:a=(i+1)%r.length;break;case`ArrowLeft`:case`ArrowUp`:a=(i-1+r.length)%r.length;break;case`Home`:a=0;break;case`End`:a=r.length-1;break;default:return}e.preventDefault();let o=r[a];o.focus(),this.activateTab(o.dataset.tabTarget)}openBackupDialog(){let e=this.shadowRoot?.querySelector(`[data-setting="include-plaintext-passwords"]`);e instanceof HTMLInputElement&&(e.checked=!1),this.showDialog(`.settings__backup-dialog`)}openClearDialog(){this.showDialog(`.settings__clear-dialog`)}openRestoreDialog(e){let t=this.shadowRoot?.querySelector(`[data-info="restore-filename"]`);t instanceof HTMLElement&&(t.textContent=`Selected file: ${e}`),this.showDialog(`.settings__restore-dialog`)}showDialog(e){let t=this.getDialog(e);if(t){if(typeof t.showModal==`function`){t.showModal();return}t.setAttribute(`open`,``)}}async confirmBackup(){if(!this.db){f(`Settings database is unavailable`,5e3);return}let e=this.shadowRoot?.querySelector(`[data-setting="include-plaintext-passwords"]`),t=e instanceof HTMLInputElement&&e.checked;try{if(t){let e=await this.promptForPlaintextBackupHandle();if(!e)return;await b(e,await this.getAllConfigEntries(),t),this.closeDialog(`.settings__backup-dialog`),u(`Settings backup saved`,3e3);return}let e=await y(await this.getAllConfigEntries(),t),n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=`shadowclaw-settings-backup-${Date.now()}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),this.closeDialog(`.settings__backup-dialog`),u(`Settings backup downloaded`,3e3)}catch(e){f(`Failed to backup settings: ${e instanceof Error?e.message:String(e)}`,6e3)}}async confirmClear(){if(!this.db){f(`Settings database is unavailable`,5e3);return}try{await this.replaceConfigEntries([]),this.closeDialog(`.settings__clear-dialog`),d(`Settings cleared. Reloading app...`,3200),setTimeout(()=>{window.location.reload()},250)}catch(e){f(`Failed to clear settings: ${e instanceof Error?e.message:String(e)}`,6e3)}}async confirmRestore(){if(!this.db){f(`Settings database is unavailable`,5e3);return}let e=this.pendingRestoreFile;if(!e){f(`No backup file selected`,4e3);return}try{let t=S(await e.text()),n=await x(t.configEntries,t.plaintextPasswords||[]);await this.replaceConfigEntries(n),this.pendingRestoreFile=null,this.closeDialog(`.settings__restore-dialog`),u(`Settings restored. Reloading app...`,3200),setTimeout(()=>{window.location.reload()},250)}catch(e){f(`Failed to restore settings: ${e instanceof Error?e.message:String(e)}`,6e3)}}async getAllConfigEntries(){if(!this.db)throw Error(`Database is unavailable`);return await new Promise((e,t)=>{try{let n=this.db?.transaction(`config`,`readonly`);if(!n){t(Error(`Failed to open read transaction`));return}let r=n.objectStore(`config`).getAll();r.onsuccess=()=>{e((Array.isArray(r.result)?r.result:[]).filter(e=>e&&typeof e.key==`string`).map(e=>({key:e.key,value:e.value})))},r.onerror=()=>{t(r.error||Error(`Failed to read settings config`))}}catch(e){t(e)}})}async onActivityLogDiskLoggingToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.ACTIVITY_LOG_DISK_LOGGING_ENABLED,t?`true`:`false`),u(t?`Activity log disk logging enabled`:`Activity log disk logging disabled`,2500)}catch(e){f(`Error saving activity log disk logging setting: `+(e instanceof Error?e.message:String(e)),6e3)}}async onChatSplitViewToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.CHAT_SPLIT_VIEW_ENABLED,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`chat-split-view-change`,{detail:{enabled:t},bubbles:!0,composed:!0})),u(t?`Horizontal Chat split view enabled`:`Horizontal Chat split view disabled`,2500)}catch(e){f(`Error saving Chat split view setting: `+(e instanceof Error?e.message:String(e)),6e3)}}async onOverridePrerenderSkeletonToggle(t){try{a(`shadow-claw-override-prerender-skeleton`,t?`true`:`false`)}catch(e){console.warn(`Unable to save setting to localStorage:`,e)}if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.OVERRIDE_PRERENDER_SKELETON,t?`true`:`false`),u(t?`Pre-rendered content override enabled`:`Pre-rendered content override disabled`,2500)}catch(e){f(`Error saving pre-rendered content override setting: `+(e instanceof Error?e.message:String(e)),6e3)}}async onPagesAutoRefreshInputChange(t){if(!this.db)return;let n=Math.max(0,Math.min(t,86400));try{let{setConfig:t}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await t(this.db,e.PAGES_AUTO_REFRESH_INTERVAL,String(n)),window.dispatchEvent(new CustomEvent(`shadow-claw-pages-auto-refresh-change`,{detail:{interval:n}})),u(n>0?`Pages auto refresh set to ${n}s`:`Pages auto refresh disabled`,2500)}catch(e){f(`Error saving Pages auto refresh interval: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHideChatToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_CHAT_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-chat-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Chat hidden in sidebar`:`Chat shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Chat visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHideFilesToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_FILES_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-files-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Files hidden in sidebar`:`Files shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Files visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHidePagesToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_PAGES_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-pages-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Pages hidden in sidebar`:`Pages shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Pages visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHideTasksToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_TASKS_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-tasks-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Tasks hidden in sidebar`:`Tasks shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Tasks visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async populateAssistantSettings(){let t=this.shadowRoot;if(!t||!this.db)return;let n=t.querySelector(`[data-setting="assistant-name-input"]`);if(n){let{getConfig:t}=await import(`./getConfig-D89uJgo5.js`).then(e=>e.n),r=await t(this.db,e.ASSISTANT_NAME),i=this.orchestrator?.assistantName||s.orchestrator?.assistantName;n.value=typeof r==`string`&&r||i||`ShadowClaw`}let{getConfig:r}=await import(`./getConfig-D89uJgo5.js`).then(e=>e.n),o=await r(this.db,e.ACTIVITY_LOG_DISK_LOGGING_ENABLED),c=o===!0||o===`true`||o===1||o===`1`,l=t.querySelector(`[data-setting="activity-log-disk-logging-toggle"]`);l&&(l.checked=c);let u=await r(this.db,e.SIDEBAR_PAGES_HIDDEN),d=u===!0||u===`true`||u===1||u===`1`,f=t.querySelector(`[data-setting="sidebar-hide-pages-toggle"]`);f&&(f.checked=d);let p=await r(this.db,e.SIDEBAR_CHAT_HIDDEN),h=p===!0||p===`true`||p===1||p===`1`,g=t.querySelector(`[data-setting="sidebar-hide-chat-toggle"]`);g&&(g.checked=h);let _=await r(this.db,e.SIDEBAR_TASKS_HIDDEN),v=_===!0||_===`true`||_===1||_===`1`,y=t.querySelector(`[data-setting="sidebar-hide-tasks-toggle"]`);y&&(y.checked=v);let b=await r(this.db,e.SIDEBAR_FILES_HIDDEN),x=b===!0||b===`true`||b===1||b===`1`,S=t.querySelector(`[data-setting="sidebar-hide-files-toggle"]`);S&&(S.checked=x);let C=m(await r(this.db,e.CHAT_SPLIT_VIEW_ENABLED),!1),w=t.querySelector(`[data-setting="chat-split-view-toggle"]`);w&&(w.checked=C);let T=t.querySelector(`[data-setting="pages-auto-refresh-input"]`);if(T){let t=await r(this.db,e.PAGES_AUTO_REFRESH_INTERVAL);if(typeof t==`string`||typeof t==`number`){let e=parseInt(String(t),10);T.value=!isNaN(e)&&e>=0?String(e):`0`}else T.value=`0`}let E=await r(this.db,e.OVERRIDE_PRERENDER_SKELETON),D=null;try{D=i(`shadow-claw-override-prerender-skeleton`)}catch{}let O=!0;if(E==null?D!==null&&(O=D===`true`):O=m(E),O)try{a(`shadow-claw-override-prerender-skeleton`,`true`)}catch{}let k=t.querySelector(`[data-setting="override-prerender-skeleton-toggle"]`);k&&(k.checked=O);let A=t.querySelector(`[data-setting="dom-allowed-iframe-hosts"]`);if(A){let t=await r(this.db,e.ALLOWED_IFRAME_HOST_PATTERNS);if(typeof t==`string`&&t.trim().length>0){A.value=t;let{setAllowedIframeHostPatterns:e}=await import(`./iframe-sanitizer-y2Z1pPwY.js`).then(e=>e.r);e(t)}else{let{DEFAULT_ALLOWED_IFRAME_HOST_PATTERNS:e}=await import(`./iframe-sanitizer-y2Z1pPwY.js`).then(e=>e.r);A.value=e.join(`
888
+ `,`text/html`),T=w.querySelector(`template`);let E=[];E=T?Array.from(T.content.children):Array.from(w.head.children).concat(Array.from(w.body.children));var D=E;const O={ai:[()=>import(`./shadow-claw-llm-Ce1Ax6-x.js`)],environment:[()=>import(`./shadow-claw-networking-q4XIzdB5.js`),()=>import(`./shadow-claw-webvm-CbzH_vyX.js`),()=>import(`./shadow-claw-storage-bIrPKFhF.js`)],integrations:[()=>import(`./shadow-claw-git-vTOKatwd.js`),()=>import(`./shadow-claw-accounts-xUOLBsQZ.js`),()=>import(`./shadow-claw-mcp-remote-Bkx0gsmF.js`),()=>import(`./shadow-claw-control-plane-BBa7WbTg.js`),()=>import(`./shadow-claw-integrations-BBVnO0Fc.js`),()=>import(`./shadow-claw-task-server-5yqVBxy1.js`),()=>import(`./shadow-claw-notifications-D2cz0gmm.js`)]},k=new Set;async function A(e){if(k.has(e))return;let t=O[e];t&&(k.add(e),await Promise.all(t.map(e=>e())))}const j=`shadow-claw-settings`;var M=class extends p{static styles=C;static template=D;activeTab=`ai`;db=null;orchestrator=null;pendingRestoreFile=null;constructor(){super()}async connectedCallback(){if(!this.shadowRoot)throw Error(`shadowRoot not found`);this.db=await t(),this.orchestrator=s.orchestrator,await this.render()}activateTab(e){!e||this.activeTab===e||(this.activeTab=e,this.applyTabState())}applyTabState(){A(this.activeTab).catch(console.error);let e=this.shadowRoot;e&&(e.querySelectorAll(`[data-tab-target]`).forEach(e=>{let t=e.dataset.tabTarget===this.activeTab;e.classList.toggle(`active`,t),e.setAttribute(`aria-selected`,String(t)),e.tabIndex=t?0:-1}),e.querySelectorAll(`[data-tab-panel]`).forEach(e=>{e.hidden=e.dataset.tabPanel!==this.activeTab}))}bindSettingsActions(){let e=this.shadowRoot;if(!e)return;e.querySelector(`[data-action="backup-settings"]`)?.addEventListener(`click`,()=>this.openBackupDialog());let t=e.querySelector(`.settings__restore-input`);e.querySelector(`[data-action="restore-settings"]`)?.addEventListener(`click`,()=>{t instanceof HTMLInputElement&&(t.value=``,t.click())}),t?.addEventListener(`change`,e=>{let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.files?.[0]||null;n&&(this.pendingRestoreFile=n,this.openRestoreDialog(n.name))}),e.querySelector(`[data-action="clear-settings"]`)?.addEventListener(`click`,()=>this.openClearDialog()),e.querySelector(`[data-action="cancel-backup-settings"]`)?.addEventListener(`click`,()=>this.closeDialog(`.settings__backup-dialog`)),e.querySelector(`[data-action="confirm-backup-settings"]`)?.addEventListener(`click`,()=>{this.confirmBackup()}),e.querySelector(`[data-action="cancel-restore-settings"]`)?.addEventListener(`click`,()=>{this.pendingRestoreFile=null,this.closeDialog(`.settings__restore-dialog`)}),e.querySelector(`[data-action="confirm-restore-settings"]`)?.addEventListener(`click`,()=>{this.confirmRestore()}),e.querySelector(`[data-action="cancel-clear-settings"]`)?.addEventListener(`click`,()=>this.closeDialog(`.settings__clear-dialog`)),e.querySelector(`[data-action="confirm-clear-settings"]`)?.addEventListener(`click`,()=>{this.confirmClear()}),e.querySelector(`[data-action="save-assistant-name"]`)?.addEventListener(`click`,()=>this.saveAssistantName()),e.querySelector(`[data-setting="activity-log-disk-logging-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onActivityLogDiskLoggingToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-pages-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHidePagesToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-chat-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHideChatToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-tasks-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHideTasksToggle(t.checked)}),e.querySelector(`[data-setting="sidebar-hide-files-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onSidebarHideFilesToggle(t.checked)}),e.querySelector(`[data-setting="chat-split-view-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onChatSplitViewToggle(t.checked)}),e.querySelector(`[data-setting="pages-auto-refresh-input"]`)?.addEventListener(`change`,e=>{let t=e.target;if(t){let e=parseInt(t.value,10);this.onPagesAutoRefreshInputChange(isNaN(e)?0:e)}}),e.querySelector(`[data-setting="override-prerender-skeleton-toggle"]`)?.addEventListener(`change`,e=>{let t=e.target;t&&this.onOverridePrerenderSkeletonToggle(t.checked)}),e.querySelector(`[data-action="save-dom-allowed-iframe-hosts"]`)?.addEventListener(`click`,()=>{this.saveDomAllowedIframeHosts()})}closeDialog(e){this.getDialog(e)?.close()}getDialog(e){let t=this.shadowRoot;if(!t)return null;let n=t.querySelector(e);return n instanceof HTMLDialogElement?n:null}handleTabKeydown(e,t){let n=this.shadowRoot;if(!n)return;let r=Array.from(n.querySelectorAll(`[data-tab-target]`)),i=r.indexOf(t);if(i<0)return;let a=-1;switch(e.key){case`ArrowRight`:case`ArrowDown`:a=(i+1)%r.length;break;case`ArrowLeft`:case`ArrowUp`:a=(i-1+r.length)%r.length;break;case`Home`:a=0;break;case`End`:a=r.length-1;break;default:return}e.preventDefault();let o=r[a];o.focus(),this.activateTab(o.dataset.tabTarget)}openBackupDialog(){let e=this.shadowRoot?.querySelector(`[data-setting="include-plaintext-passwords"]`);e instanceof HTMLInputElement&&(e.checked=!1),this.showDialog(`.settings__backup-dialog`)}openClearDialog(){this.showDialog(`.settings__clear-dialog`)}openRestoreDialog(e){let t=this.shadowRoot?.querySelector(`[data-info="restore-filename"]`);t instanceof HTMLElement&&(t.textContent=`Selected file: ${e}`),this.showDialog(`.settings__restore-dialog`)}showDialog(e){let t=this.getDialog(e);if(t){if(typeof t.showModal==`function`){t.showModal();return}t.setAttribute(`open`,``)}}async confirmBackup(){if(!this.db){f(`Settings database is unavailable`,5e3);return}let e=this.shadowRoot?.querySelector(`[data-setting="include-plaintext-passwords"]`),t=e instanceof HTMLInputElement&&e.checked;try{if(t){let e=await this.promptForPlaintextBackupHandle();if(!e)return;await b(e,await this.getAllConfigEntries(),t),this.closeDialog(`.settings__backup-dialog`),u(`Settings backup saved`,3e3);return}let e=await y(await this.getAllConfigEntries(),t),n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=`shadowclaw-settings-backup-${Date.now()}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),this.closeDialog(`.settings__backup-dialog`),u(`Settings backup downloaded`,3e3)}catch(e){f(`Failed to backup settings: ${e instanceof Error?e.message:String(e)}`,6e3)}}async confirmClear(){if(!this.db){f(`Settings database is unavailable`,5e3);return}try{await this.replaceConfigEntries([]),this.closeDialog(`.settings__clear-dialog`),d(`Settings cleared. Reloading app...`,3200),setTimeout(()=>{window.location.reload()},250)}catch(e){f(`Failed to clear settings: ${e instanceof Error?e.message:String(e)}`,6e3)}}async confirmRestore(){if(!this.db){f(`Settings database is unavailable`,5e3);return}let e=this.pendingRestoreFile;if(!e){f(`No backup file selected`,4e3);return}try{let t=S(await e.text()),n=await x(t.configEntries,t.plaintextPasswords||[]);await this.replaceConfigEntries(n),this.pendingRestoreFile=null,this.closeDialog(`.settings__restore-dialog`),u(`Settings restored. Reloading app...`,3200),setTimeout(()=>{window.location.reload()},250)}catch(e){f(`Failed to restore settings: ${e instanceof Error?e.message:String(e)}`,6e3)}}async getAllConfigEntries(){if(!this.db)throw Error(`Database is unavailable`);return await new Promise((e,t)=>{try{let n=this.db?.transaction(`config`,`readonly`);if(!n){t(Error(`Failed to open read transaction`));return}let r=n.objectStore(`config`).getAll();r.onsuccess=()=>{e((Array.isArray(r.result)?r.result:[]).filter(e=>e&&typeof e.key==`string`).map(e=>({key:e.key,value:e.value})))},r.onerror=()=>{t(r.error||Error(`Failed to read settings config`))}}catch(e){t(e)}})}async onActivityLogDiskLoggingToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.ACTIVITY_LOG_DISK_LOGGING_ENABLED,t?`true`:`false`),u(t?`Activity log disk logging enabled`:`Activity log disk logging disabled`,2500)}catch(e){f(`Error saving activity log disk logging setting: `+(e instanceof Error?e.message:String(e)),6e3)}}async onChatSplitViewToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.CHAT_SPLIT_VIEW_ENABLED,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`chat-split-view-change`,{detail:{enabled:t},bubbles:!0,composed:!0})),u(t?`Horizontal Chat split view enabled`:`Horizontal Chat split view disabled`,2500)}catch(e){f(`Error saving Chat split view setting: `+(e instanceof Error?e.message:String(e)),6e3)}}async onOverridePrerenderSkeletonToggle(t){try{a(`shadow-claw-override-prerender-skeleton`,t?`true`:`false`)}catch(e){console.warn(`Unable to save setting to localStorage:`,e)}if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.OVERRIDE_PRERENDER_SKELETON,t?`true`:`false`),u(t?`Pre-rendered content override enabled`:`Pre-rendered content override disabled`,2500)}catch(e){f(`Error saving pre-rendered content override setting: `+(e instanceof Error?e.message:String(e)),6e3)}}async onPagesAutoRefreshInputChange(t){if(!this.db)return;let n=Math.max(0,Math.min(t,86400));try{let{setConfig:t}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await t(this.db,e.PAGES_AUTO_REFRESH_INTERVAL,String(n)),window.dispatchEvent(new CustomEvent(`shadow-claw-pages-auto-refresh-change`,{detail:{interval:n}})),u(n>0?`Pages auto refresh set to ${n}s`:`Pages auto refresh disabled`,2500)}catch(e){f(`Error saving Pages auto refresh interval: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHideChatToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_CHAT_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-chat-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Chat hidden in sidebar`:`Chat shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Chat visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHideFilesToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_FILES_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-files-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Files hidden in sidebar`:`Files shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Files visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHidePagesToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_PAGES_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-pages-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Pages hidden in sidebar`:`Pages shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Pages visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async onSidebarHideTasksToggle(t){if(this.db)try{let{setConfig:n}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await n(this.db,e.SIDEBAR_TASKS_HIDDEN,t?`true`:`false`),this.dispatchEvent(new CustomEvent(`sidebar-tasks-visibility-change`,{detail:{hidden:t},bubbles:!0,composed:!0})),u(t?`Tasks hidden in sidebar`:`Tasks shown in sidebar`,2500)}catch(e){f(`Error saving sidebar Tasks visibility: `+(e instanceof Error?e.message:String(e)),6e3)}}async populateAssistantSettings(){let t=this.shadowRoot;if(!t||!this.db)return;let n=t.querySelector(`[data-setting="assistant-name-input"]`);if(n){let{getConfig:t}=await import(`./getConfig-D89uJgo5.js`).then(e=>e.n),r=await t(this.db,e.ASSISTANT_NAME),i=this.orchestrator?.assistantName||s.orchestrator?.assistantName;n.value=typeof r==`string`&&r||i||`ShadowClaw`}let{getConfig:r}=await import(`./getConfig-D89uJgo5.js`).then(e=>e.n),o=await r(this.db,e.ACTIVITY_LOG_DISK_LOGGING_ENABLED),c=o===!0||o===`true`||o===1||o===`1`,l=t.querySelector(`[data-setting="activity-log-disk-logging-toggle"]`);l&&(l.checked=c);let u=await r(this.db,e.SIDEBAR_PAGES_HIDDEN),d=u===!0||u===`true`||u===1||u===`1`,f=t.querySelector(`[data-setting="sidebar-hide-pages-toggle"]`);f&&(f.checked=d);let p=await r(this.db,e.SIDEBAR_CHAT_HIDDEN),h=p===!0||p===`true`||p===1||p===`1`,g=t.querySelector(`[data-setting="sidebar-hide-chat-toggle"]`);g&&(g.checked=h);let _=await r(this.db,e.SIDEBAR_TASKS_HIDDEN),v=_===!0||_===`true`||_===1||_===`1`,y=t.querySelector(`[data-setting="sidebar-hide-tasks-toggle"]`);y&&(y.checked=v);let b=await r(this.db,e.SIDEBAR_FILES_HIDDEN),x=b===!0||b===`true`||b===1||b===`1`,S=t.querySelector(`[data-setting="sidebar-hide-files-toggle"]`);S&&(S.checked=x);let C=m(await r(this.db,e.CHAT_SPLIT_VIEW_ENABLED),!1),w=t.querySelector(`[data-setting="chat-split-view-toggle"]`);w&&(w.checked=C);let T=t.querySelector(`[data-setting="pages-auto-refresh-input"]`);if(T){let t=await r(this.db,e.PAGES_AUTO_REFRESH_INTERVAL);if(typeof t==`string`||typeof t==`number`){let e=parseInt(String(t),10);T.value=!isNaN(e)&&e>=0?String(e):`0`}else T.value=`0`}let E=await r(this.db,e.OVERRIDE_PRERENDER_SKELETON),D=null;try{D=i(`shadow-claw-override-prerender-skeleton`)}catch{}let O=!0;if(E==null?D!==null&&(O=D===`true`):O=m(E),O)try{a(`shadow-claw-override-prerender-skeleton`,`true`)}catch{}let k=t.querySelector(`[data-setting="override-prerender-skeleton-toggle"]`);k&&(k.checked=O);let A=t.querySelector(`[data-setting="dom-allowed-iframe-hosts"]`);if(A){let t=await r(this.db,e.ALLOWED_IFRAME_HOST_PATTERNS);if(typeof t==`string`&&t.trim().length>0){A.value=t;let{setAllowedIframeHostPatterns:e}=await import(`./iframe-sanitizer-y2Z1pPwY.js`).then(e=>e.r);e(t)}else{let{DEFAULT_ALLOWED_IFRAME_HOST_PATTERNS:e}=await import(`./iframe-sanitizer-y2Z1pPwY.js`).then(e=>e.r);A.value=e.join(`
889
889
  `)}}let j=t.querySelector(`[data-setting="markdown-frontmatter-pages-toggle"]`);j&&(j.checked=m(await r(this.db,e.MARKDOWN_FRONTMATTER_PAGES),!0));let M=t.querySelector(`[data-setting="markdown-frontmatter-file-viewer-toggle"]`);M&&(M.checked=m(await r(this.db,e.MARKDOWN_FRONTMATTER_FILE_VIEWER),!0));let N=t.querySelector(`[data-setting="markdown-frontmatter-chat-toggle"]`);N&&(N.checked=m(await r(this.db,e.MARKDOWN_FRONTMATTER_CHAT),!0));let P=t.querySelector(`[data-setting="markdown-frontmatter-tasks-toggle"]`);P&&(P.checked=m(await r(this.db,e.MARKDOWN_FRONTMATTER_TASKS),!0))}async promptForPlaintextBackupHandle(){let e=Reflect.get(globalThis,`showSaveFilePicker`),t=typeof e==`function`?e.bind(globalThis):null;if(!t)throw Error(`Plaintext settings backup requires the File System Access API.`);try{return await t({id:`shadowclaw-settings-backup`,suggestedName:`shadowclaw-settings-backup-${n()}.json`,types:[{description:`JSON Files`,accept:{"application/json":[`.json`]}}]})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return null;throw e}}async render(){let e=this.shadowRoot;if(!e)return;e.querySelector(`[data-action="show-channels-config"]`)?.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`navigate`,{detail:{page:`channels`},bubbles:!0,composed:!0}))}),e.querySelector(`[data-action="show-tools-config"]`)?.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`navigate`,{detail:{page:`tools`},bubbles:!0,composed:!0}))}),e.querySelectorAll(`[data-tab-target]`).forEach(e=>{e.addEventListener(`click`,()=>{this.activateTab(e.dataset.tabTarget)}),e.addEventListener(`keydown`,t=>{this.handleTabKeydown(t,e)})}),this.applyTabState(),this.bindSettingsActions();let t=e.querySelector(`[data-info="deployed-revision"]`);t&&(t.textContent=`Deployed revision: ${document.querySelector(`meta[name="revision"]`)?.getAttribute(`content`)?.trim()||`unknown`}`),await this.populateAssistantSettings()}async replaceConfigEntries(e){if(!this.db)throw Error(`Database is unavailable`);await new Promise((t,n)=>{try{let r=this.db?.transaction(`config`,`readwrite`);if(!r){n(Error(`Failed to open write transaction`));return}let i=r.objectStore(`config`);i.clear();for(let t of e)i.put({key:t.key,value:t.value});r.oncomplete=()=>t(),r.onerror=()=>n(r.error||Error(`Failed to update config`)),r.onabort=()=>n(r.error||Error(`Config update aborted`))}catch(e){n(e)}})}async saveAssistantName(){if(!this.db)return;let t=this.shadowRoot;if(!t)return;let n=t.querySelector(`[data-setting="assistant-name-input"]`);if(!n)return;let i=n.value.trim();if(!i){let{showWarning:e}=await import(`./toast-BXgUfbyh.js`).then(e=>e.c);e(`Please enter a name`,3e3);return}a(`assistantName`,i);try{let t=this.orchestrator||s.orchestrator;if(t)this.orchestrator=t,await r(t,this.db,i);else{let{setConfig:t}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n);await t(this.db,e.ASSISTANT_NAME,i)}}catch(e){console.warn(`Could not update orchestrator:`,e)}u(`Assistant name saved`,3e3)}async saveDomAllowedIframeHosts(){let t=this.shadowRoot;if(!t||!this.db)return;let n=t.querySelector(`[data-setting="dom-allowed-iframe-hosts"]`);if(!n)return;let r=n.value.split(`
890
890
  `).map(e=>e.trim()).filter(e=>e.length>0),i=t.querySelector(`[data-setting="markdown-frontmatter-pages-toggle"]`),a=t.querySelector(`[data-setting="markdown-frontmatter-file-viewer-toggle"]`),o=t.querySelector(`[data-setting="markdown-frontmatter-chat-toggle"]`),s=t.querySelector(`[data-setting="markdown-frontmatter-tasks-toggle"]`);try{let{setConfig:t}=await import(`./setConfig-DFMYnYLE.js`).then(e=>e.n),n=r.join(`
891
891
  `);await t(this.db,e.ALLOWED_IFRAME_HOST_PATTERNS,n),await t(this.db,e.MARKDOWN_FRONTMATTER_PAGES,String(i?.checked??!0)),await t(this.db,e.MARKDOWN_FRONTMATTER_FILE_VIEWER,String(a?.checked??!0)),await t(this.db,e.MARKDOWN_FRONTMATTER_CHAT,String(o?.checked??!0)),await t(this.db,e.MARKDOWN_FRONTMATTER_TASKS,String(s?.checked??!0));let{setAllowedIframeHostPatterns:c}=await import(`./iframe-sanitizer-y2Z1pPwY.js`).then(e=>e.r);c(r),u(`DOM iframe embed settings saved`,2500)}catch(e){f(`Error saving DOM iframe embed settings: `+(e instanceof Error?e.message:String(e)),6e3)}}};customElements.get(j)||customElements.define(j,M);export{M as ShadowClawSettings};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b.js";import{t as n}from"./getConfig-D89uJgo5.js";import{u as r}from"./custom-element-security-FU04Cq05.js";import{en as i,t as a,tn as o}from"./orchestrator-BT3Ks5ip.js";import{c as s}from"./getGroupDir-P1h9wl6S.js";import{t as c}from"./setConfig-DFMYnYLE.js";import{a as l,r as u,s as d}from"./toast-BXgUfbyh.js";import{t as f}from"./shadow-claw-element-DIrv3P6A.js";import{t as p}from"./effect-BJCrpFdp.js";import{t as m}from"./config-value-oBfKgLT4.js";async function h(){try{if(typeof navigator<`u`&&navigator.storage&&navigator.storage.estimate){let e=await navigator.storage.estimate();return{usage:e.usage||0,quota:e.quota||0}}}catch(e){console.warn(`Failed to get storage estimate:`,e)}return{usage:0,quota:0}}async function g(){try{if(typeof navigator<`u`&&navigator.storage&&navigator.storage.persisted)return await navigator.storage.persisted()}catch(e){console.warn(`Failed to check persistent storage:`,e)}return!1}async function _(){try{if(typeof navigator<`u`&&navigator.storage&&navigator.storage.persist)return await navigator.storage.persist()}catch(e){console.warn(`Failed to request persistent storage:`,e)}return!1}async function v(t){let n=Reflect.get(globalThis,`showDirectoryPicker`),r=typeof n==`function`?n.bind(globalThis):null;if(!r)throw Error(`Local folder picker is unavailable in this browser/context.`);try{let n=await r({mode:`readwrite`,id:`shadowclaw-storage`});return await c(t,e.STORAGE_HANDLE,n),await o(t),await i(t),!0}catch(e){if(e instanceof Error&&e.name===`AbortError`)return!1;throw e}}const y=new CSSStyleSheet;y.replaceSync(`*,
1
+ import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b.js";import{t as n}from"./getConfig-D89uJgo5.js";import{u as r}from"./custom-element-security-FU04Cq05.js";import{en as i,t as a,tn as o}from"./orchestrator-DpkkeD6T.js";import{c as s}from"./getGroupDir-P1h9wl6S.js";import{t as c}from"./setConfig-DFMYnYLE.js";import{a as l,r as u,s as d}from"./toast-BXgUfbyh.js";import{t as f}from"./shadow-claw-element-DIrv3P6A.js";import{t as p}from"./effect-BJCrpFdp.js";import{t as m}from"./config-value-oBfKgLT4.js";async function h(){try{if(typeof navigator<`u`&&navigator.storage&&navigator.storage.estimate){let e=await navigator.storage.estimate();return{usage:e.usage||0,quota:e.quota||0}}}catch(e){console.warn(`Failed to get storage estimate:`,e)}return{usage:0,quota:0}}async function g(){try{if(typeof navigator<`u`&&navigator.storage&&navigator.storage.persisted)return await navigator.storage.persisted()}catch(e){console.warn(`Failed to check persistent storage:`,e)}return!1}async function _(){try{if(typeof navigator<`u`&&navigator.storage&&navigator.storage.persist)return await navigator.storage.persist()}catch(e){console.warn(`Failed to request persistent storage:`,e)}return!1}async function v(t){let n=Reflect.get(globalThis,`showDirectoryPicker`),r=typeof n==`function`?n.bind(globalThis):null;if(!r)throw Error(`Local folder picker is unavailable in this browser/context.`);try{let n=await r({mode:`readwrite`,id:`shadowclaw-storage`});return await c(t,e.STORAGE_HANDLE,n),await o(t),await i(t),!0}catch(e){if(e instanceof Error&&e.name===`AbortError`)return!1;throw e}}const y=new CSSStyleSheet;y.replaceSync(`*,
2
2
  *::before,
3
3
  *::after {
4
4
  font-family: var(--shadow-claw-font-sans);
@@ -1,4 +1,4 @@
1
- import{n as e}from"./txPromise-EBECky1b.js";import{b as t,t as n,y as r}from"./orchestrator-BT3Ks5ip.js";import{a as i,r as a}from"./toast-BXgUfbyh.js";import{t as o}from"./shadow-claw-element-DIrv3P6A.js";import{t as s}from"./effect-BJCrpFdp.js";const c=new CSSStyleSheet;c.replaceSync(`*,
1
+ import{n as e}from"./txPromise-EBECky1b.js";import{b as t,t as n,y as r}from"./orchestrator-DpkkeD6T.js";import{a as i,r as a}from"./toast-BXgUfbyh.js";import{t as o}from"./shadow-claw-element-DIrv3P6A.js";import{t as s}from"./effect-BJCrpFdp.js";const c=new CSSStyleSheet;c.replaceSync(`*,
2
2
  *::before,
3
3
  *::after {
4
4
  font-family: var(--shadow-claw-font-sans);
@@ -1,4 +1,4 @@
1
- import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b.js";import{t as n}from"./getConfig-D89uJgo5.js";import{m as r,u as i}from"./custom-element-security-FU04Cq05.js";import{t as a}from"./orchestrator-BT3Ks5ip.js";import{a as o,i as s,r as c}from"./toast-BXgUfbyh.js";import{t as l}from"./shadow-claw-element-DIrv3P6A.js";import"./shadow-claw-empty-state-Bl52dGQ0.js";import{t as u}from"./effect-BJCrpFdp.js";import{t as d}from"./config-value-oBfKgLT4.js";import"./shadow-claw-page-header-action-button-Bmua3mAb.js";import"./shadow-claw-page-header-BccSHItx.js";import{t as f}from"./markdown-C-hCVJtc.js";import{t as p}from"./file-viewer-CKtVC9Ix.js";import"./shadow-claw-dialog-BrOwAOdk.js";const m=new CSSStyleSheet;m.replaceSync(`*,
1
+ import{r as e}from"./config-CrHchneq.js";import{n as t}from"./txPromise-EBECky1b.js";import{t as n}from"./getConfig-D89uJgo5.js";import{m as r,u as i}from"./custom-element-security-FU04Cq05.js";import{t as a}from"./orchestrator-DpkkeD6T.js";import{a as o,i as s,r as c}from"./toast-BXgUfbyh.js";import{t as l}from"./shadow-claw-element-DIrv3P6A.js";import"./shadow-claw-empty-state-Bl52dGQ0.js";import{t as u}from"./effect-BJCrpFdp.js";import{t as d}from"./config-value-oBfKgLT4.js";import"./shadow-claw-page-header-action-button-Bmua3mAb.js";import"./shadow-claw-page-header-BccSHItx.js";import{t as f}from"./markdown-Cw7vCtTg.js";import{t as p}from"./file-viewer-Cs-riNvy.js";import"./shadow-claw-dialog-BrOwAOdk.js";const m=new CSSStyleSheet;m.replaceSync(`*,
2
2
  *::before,
3
3
  *::after {
4
4
  font-family: var(--shadow-claw-font-sans);
@@ -1,4 +1,4 @@
1
- import{D as e,E as t,T as n,t as r}from"./orchestrator-BT3Ks5ip.js";import{t as i}from"./shadow-claw-element-DIrv3P6A.js";function a(e){if(!e)return``;let t=e.split(`
1
+ import{D as e,E as t,T as n,t as r}from"./orchestrator-DpkkeD6T.js";import{t as i}from"./shadow-claw-element-DIrv3P6A.js";function a(e){if(!e)return``;let t=e.split(`
2
2
  `);for(let e=t.length-1;e>=0;--e){let n=t[e]||``;if(/[#$](?:\s|$)/.test(n))return n}return``}function o(e){return e.scrollHeight-(e.scrollTop+e.clientHeight)<=12}function s(e,t){let n=e[t+1];if(n===void 0)return{action:`ignore`,nextIndex:t+1,incomplete:!0};if(n===`[`){let n=t+2;for(;n<e.length;){let t=e.charCodeAt(n);if(t>=64&&t<=126){let t=e[n];return t===`J`?{action:`clear-screen`,nextIndex:n+1}:t===`K`?{action:`clear-line`,nextIndex:n+1}:{action:`ignore`,nextIndex:n+1}}n+=1}return{action:`ignore`,nextIndex:e.length,incomplete:!0}}if(n===`]`){let n=t+2;for(;n<e.length;){let t=e[n];if(t===`\x07`)return{action:`ignore`,nextIndex:n+1};if(t===`\x1B`&&e[n+1]===`\\`)return{action:`ignore`,nextIndex:n+2};n+=1}return{action:`ignore`,nextIndex:e.length,incomplete:!0}}return{action:`ignore`,nextIndex:Math.min(t+2,e.length)}}function c(e){return e.replace(/(?:^|\n)[^\n]*mkdir -p \/home\/user 2>&1; echo "?__BCDONE_\d+__\$\?"?[^\n]*(?:\n|$)/g,`
3
3
  `).replace(/(?:^|\n)\s*__BCDONE_\d+__(?:\d+|\$\?)?\s*(?:\n|$)/g,`
4
4
  `).replace(/^\n+(?=\S)/,``)}function l(e,t,n=``,r){let i=r?.respectEraseSequences??!0,a=n+t,o=e;for(let e=0;e<a.length;e++){let t=a[e];if(t===`\x1B`){let t=s(a,e);if(t.incomplete)return{text:o,pending:a.slice(e)};if(t.action===`clear-screen`&&i&&(o=``),t.action===`clear-line`&&i){let e=o.lastIndexOf(`
@@ -1,4 +1,4 @@
1
- import{A as e,F as t}from"./config-CrHchneq.js";import{n}from"./txPromise-EBECky1b.js";import{t as r}from"./orchestrator-BT3Ks5ip.js";import{t as i}from"./tools-DvckJZG2.js";import{t as a}from"./ulid-BY7rQVLN.js";import{t as o}from"./tools-C8x3nmo4.js";import{n as s,t as c}from"./syncWebMcpRegistration-n2vAMJ4w.js";import"./tools-COduyYJ0.js";import{a as l,i as u,r as d}from"./toast-BXgUfbyh.js";import{t as f}from"./shadow-claw-element-DIrv3P6A.js";import{t as p}from"./effect-BJCrpFdp.js";import"./shadow-claw-page-header-action-button-Bmua3mAb.js";import"./shadow-claw-page-header-BccSHItx.js";import"./shadow-claw-dialog-BrOwAOdk.js";import{t as m}from"./webmcp-DAjmliCx.js";const h=new CSSStyleSheet;h.replaceSync(`*,
1
+ import{A as e,F as t}from"./config-CrHchneq.js";import{n}from"./txPromise-EBECky1b.js";import{t as r}from"./orchestrator-DpkkeD6T.js";import{t as i}from"./tools-DvckJZG2.js";import{t as a}from"./ulid-BY7rQVLN.js";import{t as o}from"./tools-C8x3nmo4.js";import{n as s,t as c}from"./syncWebMcpRegistration-CWSYaHex.js";import"./tools-COduyYJ0.js";import{a as l,i as u,r as d}from"./toast-BXgUfbyh.js";import{t as f}from"./shadow-claw-element-DIrv3P6A.js";import{t as p}from"./effect-BJCrpFdp.js";import"./shadow-claw-page-header-action-button-Bmua3mAb.js";import"./shadow-claw-page-header-BccSHItx.js";import"./shadow-claw-dialog-BrOwAOdk.js";import{t as m}from"./webmcp-DAjmliCx.js";const h=new CSSStyleSheet;h.replaceSync(`*,
2
2
  *::before,
3
3
  *::after {
4
4
  font-family: var(--shadow-claw-font-sans);
@@ -1,4 +1,4 @@
1
- import{f as e,n as t,r as n}from"./config-CrHchneq.js";import{n as r}from"./txPromise-EBECky1b.js";import{t as i}from"./getConfig-D89uJgo5.js";import{A as a,O as o,S as s,k as c,t as l}from"./orchestrator-BT3Ks5ip.js";import{a as u,r as d,s as f}from"./toast-BXgUfbyh.js";import{t as p}from"./shadow-claw-element-DIrv3P6A.js";import{t as m}from"./effect-BJCrpFdp.js";const h=new CSSStyleSheet;h.replaceSync(`*,
1
+ import{f as e,n as t,r as n}from"./config-CrHchneq.js";import{n as r}from"./txPromise-EBECky1b.js";import{t as i}from"./getConfig-D89uJgo5.js";import{A as a,O as o,S as s,k as c,t as l}from"./orchestrator-DpkkeD6T.js";import{a as u,r as d,s as f}from"./toast-BXgUfbyh.js";import{t as p}from"./shadow-claw-element-DIrv3P6A.js";import{t as m}from"./effect-BJCrpFdp.js";const h=new CSSStyleSheet;h.replaceSync(`*,
2
2
  *::before,
3
3
  *::after {
4
4
  font-family: var(--shadow-claw-font-sans);
@@ -1,4 +1,4 @@
1
- import{t as e}from"./base-task-model-CYkpwnvU-DDfHUUIS.js";import{t}from"./prompt-utils-DpfOVJQv-DorZAfZa.js";var n={"tldr|plain-text|short":`You are a skilled assistant that accurately summarizes content provided in the TEXT section.
1
+ import{t as e}from"./base-task-model-CYkpwnvU-DrXr4G1R.js";import{t}from"./prompt-utils-DpfOVJQv-DorZAfZa.js";var n={"tldr|plain-text|short":`You are a skilled assistant that accurately summarizes content provided in the TEXT section.
2
2
  Summarize the text as if explaining it to someone with a very short attention span.
3
3
  The summary must fit within one sentence.
4
4
  The summary must not contain any formatting or markup language.
@@ -1 +1 @@
1
- import{r as e}from"./config-CrHchneq.js";import{Lt as t,M as n,t as r}from"./orchestrator-BT3Ks5ip.js";import{t as i}from"./tools-DvckJZG2.js";import{t as a}from"./setConfig-DFMYnYLE.js";import{t as o}from"./effect-BJCrpFdp.js";import{i as s,n as c,r as l}from"./webmcp-DAjmliCx.js";const u={name:`activate_skill`,description:`Load the full instructions for a workspace skill when its description matches the current task.`,input_schema:{type:`object`,properties:{name:{type:`string`,description:`The exact skill name from the available skills catalog.`}},required:[`name`]}};function d(e,a){if(typeof e.webMcpEffectCleanup==`function`&&(e.webMcpEffectCleanup(),e.webMcpEffectCleanup=null),!e.webMcpToolsEnabled){s();return}e.webMcpEffectCleanup=o(()=>{let o=r.activeGroupId,l=i.allTools,d=i.enabledTools;i.declarativeTools,i.declarativeToolNamesEnabled;let f=r.groups.find(e=>e.groupId===o);e.webMcpRegistrationLock=e.webMcpRegistrationLock.then(async()=>{s(),await new Promise(e=>setTimeout(e,0));let r=[];try{r=await i.refreshDeclarativeTools(a,o)}catch{}let p=r.filter(e=>i.isDeclarativeToolEnabled(e.name)),m=[...l,...r],h=f?.toolTags&&f.toolTags.length>0?m.filter(e=>f.toolTags.includes(e.name)):[...d,...p],g={skills:[]};try{g=await t(a,o)}catch{}g.skills.length>0&&!h.some(e=>e.name===u.name)&&(h=[...h,u]),await c(e.agentWorker,async t=>{await n(e,a,t)},o,h)}).catch(e=>{console.error(`WebMCP registration failed:`,e)})})}async function f(t,n,r,i){s(),l(r),await a(n,e.WEBMCP_MODE,r),d(i.orchestrator,n)}async function p(t,n,r,i){t.webMcpToolsEnabled=!!r,await a(n,e.WEBMCP_TOOLS_ENABLED,t.webMcpToolsEnabled?`true`:`false`),d(i.orchestrator,n)}export{u as i,p as n,d as r,f as t};
1
+ import{r as e}from"./config-CrHchneq.js";import{Lt as t,M as n,t as r}from"./orchestrator-DpkkeD6T.js";import{t as i}from"./tools-DvckJZG2.js";import{t as a}from"./setConfig-DFMYnYLE.js";import{t as o}from"./effect-BJCrpFdp.js";import{i as s,n as c,r as l}from"./webmcp-DAjmliCx.js";const u={name:`activate_skill`,description:`Load the full instructions for a workspace skill when its description matches the current task.`,input_schema:{type:`object`,properties:{name:{type:`string`,description:`The exact skill name from the available skills catalog.`}},required:[`name`]}};function d(e,a){if(typeof e.webMcpEffectCleanup==`function`&&(e.webMcpEffectCleanup(),e.webMcpEffectCleanup=null),!e.webMcpToolsEnabled){s();return}e.webMcpEffectCleanup=o(()=>{let o=r.activeGroupId,l=i.allTools,d=i.enabledTools;i.declarativeTools,i.declarativeToolNamesEnabled;let f=r.groups.find(e=>e.groupId===o);e.webMcpRegistrationLock=e.webMcpRegistrationLock.then(async()=>{s(),await new Promise(e=>setTimeout(e,0));let r=[];try{r=await i.refreshDeclarativeTools(a,o)}catch{}let p=r.filter(e=>i.isDeclarativeToolEnabled(e.name)),m=[...l,...r],h=f?.toolTags&&f.toolTags.length>0?m.filter(e=>f.toolTags.includes(e.name)):[...d,...p],g={skills:[]};try{g=await t(a,o)}catch{}g.skills.length>0&&!h.some(e=>e.name===u.name)&&(h=[...h,u]),await c(e.agentWorker,async t=>{await n(e,a,t)},o,h)}).catch(e=>{console.error(`WebMCP registration failed:`,e)})})}async function f(t,n,r,i){s(),l(r),await a(n,e.WEBMCP_MODE,r),d(i.orchestrator,n)}async function p(t,n,r,i){t.webMcpToolsEnabled=!!r,await a(n,e.WEBMCP_TOOLS_ENABLED,t.webMcpToolsEnabled?`true`:`false`),d(i.orchestrator,n)}export{u as i,p as n,d as r,f as t};
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,r as n}from"./rolldown-runtime-aKtaBQYM.js";import{_ as r,g as i}from"./agent.worker.js";import{n as a,t as o}from"./defaults-DwNb0lWM-Drx4e34U.js";var s=e(r(),1),c=t({InferenceSession:()=>Fe,TRACE:()=>Ee,TRACE_EVENT_BEGIN:()=>Ae,TRACE_EVENT_END:()=>je,TRACE_FUNC_BEGIN:()=>Oe,TRACE_FUNC_END:()=>ke,Tensor:()=>we,default:()=>dr,env:()=>D,registerBackend:()=>b});i();
1
+ import{i as e,n as t,r as n}from"./rolldown-runtime-aKtaBQYM.js";import{_ as r,v as i}from"./agent.worker.js";import{n as a,t as o}from"./defaults-DwNb0lWM-Drx4e34U.js";var s=e(i(),1),c=t({InferenceSession:()=>Fe,TRACE:()=>Ee,TRACE_EVENT_BEGIN:()=>Ae,TRACE_EVENT_END:()=>je,TRACE_FUNC_BEGIN:()=>Oe,TRACE_FUNC_END:()=>ke,Tensor:()=>we,default:()=>dr,env:()=>D,registerBackend:()=>b});r();
2
2
  /*!
3
3
  * ONNX Runtime Web v1.26.0-dev.20260416-b7804b056c
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- import{t as e}from"./base-task-model-CYkpwnvU-DDfHUUIS.js";var t=class e{#e;#t;constructor(e,t){this.#e=e,this.#t=t}static#n=`You are a helpful and accurate translator. Your goal is to translate the given text from the source language to the target language. Preserve the meaning, tone, and any formatting as much as possible. Do not include any explanations or extra text in your response, only the translated text itself. If you are unsure of the translation, provide the most likely one.`;static#r=[{role:`user`,content:`SOURCE: en
1
+ import{t as e}from"./base-task-model-CYkpwnvU-DrXr4G1R.js";var t=class e{#e;#t;constructor(e,t){this.#e=e,this.#t=t}static#n=`You are a helpful and accurate translator. Your goal is to translate the given text from the source language to the target language. Preserve the meaning, tone, and any formatting as much as possible. Do not include any explanations or extra text in your response, only the translated text itself. If you are unsure of the translation, provide the most likely one.`;static#r=[{role:`user`,content:`SOURCE: en
2
2
  TARGET: de
3
3
  TEXT: Good morning, how are you?`},{role:`assistant`,content:`Guten Morgen, wie geht es Ihnen?`},{role:`user`,content:`SOURCE: de
4
4
  TARGET: en
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{_ as t,g as n}from"./agent.worker.js";import{n as r,t as i}from"./defaults-DwNb0lWM-Drx4e34U.js";var a=e(t(),1),o=n();function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function c(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var l={exports:{}},u=l.exports,d;function f(){return d?l.exports:(d=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(u,function(){var e=function(){},t=`undefined`,n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=[`trace`,`debug`,`info`,`warn`,`error`],i={},a=null;function o(e,t){var n=e[t];if(typeof n.bind==`function`)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch{return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return r===`debug`&&(r=`log`),typeof console===t?!1:r===`trace`&&n?s:console[r]===void 0?console.log===void 0?e:o(console,`log`):o(console,r)}function l(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return`No console available for logging`}function u(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function d(e,t,n){return c(e)||u.apply(this,arguments)}function f(e,n){var o=this,s,c,u,f=`loglevel`;typeof e==`string`?f+=`:`+e:typeof e==`symbol`&&(f=void 0);function p(e){var n=(r[e]||`silent`).toUpperCase();if(!(typeof window===t||!f)){try{window.localStorage[f]=n;return}catch{}try{window.document.cookie=encodeURIComponent(f)+`=`+n+`;`}catch{}}}function m(){var e;if(!(typeof window===t||!f)){try{e=window.localStorage[f]}catch{}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+`=`);i!==-1&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function h(){if(!(typeof window===t||!f)){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+`=; expires=Thu, 01 Jan 1970 00:00:00 UTC`}catch{}}}function g(e){var t=e;if(typeof t==`string`&&o.levels[t.toUpperCase()]!==void 0&&(t=o.levels[t.toUpperCase()]),typeof t==`number`&&t>=0&&t<=o.levels.SILENT)return t;throw TypeError(`log.setLevel() called with invalid level: `+e)}o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||d,o.getLevel=function(){return u??c??s},o.setLevel=function(e,t){return u=g(e),t!==!1&&p(u),l.call(o)},o.setDefaultLevel=function(e){c=g(e),m()||o.setLevel(e,!1)},o.resetLevel=function(){u=null,h(),l.call(o)},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)},o.rebuild=function(){if(a!==o&&(s=g(a.getLevel())),l.call(o),a===o)for(var e in i)i[e].rebuild()},s=g(a?a.getLevel():`WARN`);var _=m();_!=null&&(u=g(_)),l.call(o)}a=new f,a.getLogger=function(e){if(typeof e!=`symbol`&&typeof e!=`string`||e===``)throw TypeError(`You must supply a name when creating a logger.`);var t=i[e];return t||=i[e]=new f(e,a.methodFactory),t};var p=typeof window===t?void 0:window.log;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=p),a},a.getLoggers=function(){return i},a.default=a,a})})(l),l.exports)}var p=s(f()),m=class extends Error{constructor(e){super(`Cannot find model record in appConfig for ${e}. Please check if the model ID is correct and included in the model_list configuration.`),this.name=`ModelNotFoundError`}},h=class extends Error{constructor(e){super(e),this.name=`ConfigValueError`}},g=class extends h{constructor(e,t){super(`Make sure \`${e}\` > ${t}.`),this.name=`MinValueError`}},_=class extends h{constructor(e,t,n,r){super(`Make sure ${t} < ${e} <= ${n}.${r?` `+r:``}`),this.name=`RangeError`}},v=class extends h{constructor(e){super(`Make sure ${e} >= 0.`),this.name=`NonNegativeError`}},y=class extends h{constructor(e,t){super(`Make sure ${e} to be number represented in string.${t?` Got `+t:``}`),this.name=`InvalidNumberStringError`}},b=class extends h{constructor(e,t,n){super(`${e} requires ${t} to be ${n}.`),this.name=`DependencyError`}},ee=class extends Error{constructor(){super(`WebGPU is not supported in your current environment, but it is necessary to run the WebLLM engine. Please make sure that your browser supports WebGPU and that it is enabled in your browser settings. You can also consult your browser's compatibility chart to see if it supports WebGPU. For more information about WebGPU support in your browser, visit https://webgpureport.org/`),this.name=`WebGPUNotAvailableError`}},x=class extends Error{constructor(e){super(`Model not loaded before trying to complete ${e}. Please ensure you have called MLCEngine.reload(model) to load the model before initiating APIs, or initialize your engine using CreateMLCEngine() with a valid model configuration.`),this.name=`ModelNotLoadedError`}},S=class extends Error{constructor(e){super(e),this.name=`MessageOrderError`}},te=class extends Error{constructor(){super("System prompt should always be the first message in `messages`."),this.name=`SystemMessageOrderError`}},ne=class extends Error{constructor(e){super(`${e} should have string content.`),this.name=`ContentTypeError`}},re=class extends Error{constructor(e){super(`Unsupported role of message: ${e}`),this.name=`UnsupportedRoleError`}},ie=class extends Error{constructor(e,t,n){super(`The model loaded is not of type ModelType.VLM (vision-language model). Therefore, user message only supports string content, but received: ${n}\nLoaded modelId: ${e}, modelType: ${t}`),this.name=`UserMessageContentErrorForNonVLM`}},C=class extends Error{constructor(e,t){super(`prefillChunkSize needs to be greater than imageEmbedSize because a single image's prefill cannot be chunked. Got prefillChunkSize: ${e}, imageEmbedSize: ${t}`),this.name=`PrefillChunkSizeSmallerThanImageError`}},w=class extends Error{constructor(){super(`Received image input but model does not have kernel image_embed. Make sure to only pass in image to a vision model.`),this.name=`CannotFindImageEmbedError`}},T=class extends Error{constructor(e){super(`Currently do not support field image_url.detail, but received: ${e}`),this.name=`UnsupportedDetailError`}},ae=class extends Error{constructor(e){super(`image_url.url should start with "data:image" for base64, or with "http", but got: ${e}`),this.name=`UnsupportedImageURLError`}},E=class extends Error{constructor(){super(`Each message can have at most one text contentPart, but received more than 1.`),this.name=`MultipleTextContentError`}},D=class extends Error{constructor(e,t){super(`Internal error: error encountered when parsing outputMessage for function calling. Got outputMessage: ${e}\nGot error: ${t}`),this.name=`ToolCallOutputParseError`}},oe=class extends Error{constructor(e){super(`Internal error: expect output of function calling to be an ${e}`),this.name=`ToolCallOutputInvalidTypeError`}},se=class extends Error{constructor(e,t){super(`Expect generated tool call to have fields ${e.map(e=>`"\`${e}\`"`).join(`, `)}, but got object: ${JSON.stringify(t)}`),this.name=`JSONFieldError`}},ce=class extends Error{constructor(){super("Configuration not initialized. Ensure you have called `reload()` function first."),this.name=`ConfigurationNotInitializedError`}},le=class extends Error{constructor(e){super(`Missing \`model_lib\` for the model with ID "${e}". Please ensure that \`model_lib\` is provided in \`model_list\` for each model. This URL is essential for downloading the WASM library necessary to run the model.`),this.name=`MissingModelError`}},ue=class extends Error{constructor(e){super(`This model requires feature ${e}, which is not yet supported by this browser.`),this.name=`FeatureSupportError`}},de=class extends Error{constructor(e,t){super(`The following fields in ${t} are not yet supported: \n`+e.join(`, `)),this.name=`UnsupportedFieldsError`}},fe=class extends ue{constructor(){super(`This model requires WebGPU extension shader-f16, which is not enabled in this browser. You can try to launch Chrome Canary in command line with flag "--enable-dawn-features=allow_unsafe_apis".`),this.name=`ShaderF16SupportError`}},pe=class extends Error{constructor(){super(`The WebGPU device was lost while loading the model. This issue often occurs due to running out of memory (OOM). To resolve this, try reloading with a model that has fewer parameters or uses a smaller context length.`),this.name=`DeviceLostError`}},me=class extends Error{constructor(e){super(`Cannot handle tokenizer files ${e}`),this.name=`UnsupportedTokenizerFilesError`}},he=class extends Error{constructor(e,t){super(`Only one of context_window_size and sliding_window_size can be positive. Got: context_window_size: ${e}, sliding_window_size: ${t}\nConsider modifying ModelRecord.overrides to set one of them to -1.`),this.name=`WindowSizeConfigurationError`}},ge=class extends Error{constructor(){super("Need to specify non-negative attention_sink_size if using sliding window. Consider modifying ModelRecord.overrides. Use `attention_sink_size=0` for default sliding window."),this.name=`AttentionSinkSizeError`}},_e=class extends Error{constructor(){super(`Need to specify either sliding_window_size or max_window_size.
1
+ import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{_ as t,v as n}from"./agent.worker.js";import{n as r,t as i}from"./defaults-DwNb0lWM-Drx4e34U.js";var a=e(n(),1),o=t();function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function c(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var l={exports:{}},u=l.exports,d;function f(){return d?l.exports:(d=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(u,function(){var e=function(){},t=`undefined`,n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=[`trace`,`debug`,`info`,`warn`,`error`],i={},a=null;function o(e,t){var n=e[t];if(typeof n.bind==`function`)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch{return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return r===`debug`&&(r=`log`),typeof console===t?!1:r===`trace`&&n?s:console[r]===void 0?console.log===void 0?e:o(console,`log`):o(console,r)}function l(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return`No console available for logging`}function u(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function d(e,t,n){return c(e)||u.apply(this,arguments)}function f(e,n){var o=this,s,c,u,f=`loglevel`;typeof e==`string`?f+=`:`+e:typeof e==`symbol`&&(f=void 0);function p(e){var n=(r[e]||`silent`).toUpperCase();if(!(typeof window===t||!f)){try{window.localStorage[f]=n;return}catch{}try{window.document.cookie=encodeURIComponent(f)+`=`+n+`;`}catch{}}}function m(){var e;if(!(typeof window===t||!f)){try{e=window.localStorage[f]}catch{}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+`=`);i!==-1&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function h(){if(!(typeof window===t||!f)){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+`=; expires=Thu, 01 Jan 1970 00:00:00 UTC`}catch{}}}function g(e){var t=e;if(typeof t==`string`&&o.levels[t.toUpperCase()]!==void 0&&(t=o.levels[t.toUpperCase()]),typeof t==`number`&&t>=0&&t<=o.levels.SILENT)return t;throw TypeError(`log.setLevel() called with invalid level: `+e)}o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||d,o.getLevel=function(){return u??c??s},o.setLevel=function(e,t){return u=g(e),t!==!1&&p(u),l.call(o)},o.setDefaultLevel=function(e){c=g(e),m()||o.setLevel(e,!1)},o.resetLevel=function(){u=null,h(),l.call(o)},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)},o.rebuild=function(){if(a!==o&&(s=g(a.getLevel())),l.call(o),a===o)for(var e in i)i[e].rebuild()},s=g(a?a.getLevel():`WARN`);var _=m();_!=null&&(u=g(_)),l.call(o)}a=new f,a.getLogger=function(e){if(typeof e!=`symbol`&&typeof e!=`string`||e===``)throw TypeError(`You must supply a name when creating a logger.`);var t=i[e];return t||=i[e]=new f(e,a.methodFactory),t};var p=typeof window===t?void 0:window.log;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=p),a},a.getLoggers=function(){return i},a.default=a,a})})(l),l.exports)}var p=s(f()),m=class extends Error{constructor(e){super(`Cannot find model record in appConfig for ${e}. Please check if the model ID is correct and included in the model_list configuration.`),this.name=`ModelNotFoundError`}},h=class extends Error{constructor(e){super(e),this.name=`ConfigValueError`}},g=class extends h{constructor(e,t){super(`Make sure \`${e}\` > ${t}.`),this.name=`MinValueError`}},_=class extends h{constructor(e,t,n,r){super(`Make sure ${t} < ${e} <= ${n}.${r?` `+r:``}`),this.name=`RangeError`}},v=class extends h{constructor(e){super(`Make sure ${e} >= 0.`),this.name=`NonNegativeError`}},y=class extends h{constructor(e,t){super(`Make sure ${e} to be number represented in string.${t?` Got `+t:``}`),this.name=`InvalidNumberStringError`}},b=class extends h{constructor(e,t,n){super(`${e} requires ${t} to be ${n}.`),this.name=`DependencyError`}},ee=class extends Error{constructor(){super(`WebGPU is not supported in your current environment, but it is necessary to run the WebLLM engine. Please make sure that your browser supports WebGPU and that it is enabled in your browser settings. You can also consult your browser's compatibility chart to see if it supports WebGPU. For more information about WebGPU support in your browser, visit https://webgpureport.org/`),this.name=`WebGPUNotAvailableError`}},x=class extends Error{constructor(e){super(`Model not loaded before trying to complete ${e}. Please ensure you have called MLCEngine.reload(model) to load the model before initiating APIs, or initialize your engine using CreateMLCEngine() with a valid model configuration.`),this.name=`ModelNotLoadedError`}},S=class extends Error{constructor(e){super(e),this.name=`MessageOrderError`}},te=class extends Error{constructor(){super("System prompt should always be the first message in `messages`."),this.name=`SystemMessageOrderError`}},ne=class extends Error{constructor(e){super(`${e} should have string content.`),this.name=`ContentTypeError`}},re=class extends Error{constructor(e){super(`Unsupported role of message: ${e}`),this.name=`UnsupportedRoleError`}},ie=class extends Error{constructor(e,t,n){super(`The model loaded is not of type ModelType.VLM (vision-language model). Therefore, user message only supports string content, but received: ${n}\nLoaded modelId: ${e}, modelType: ${t}`),this.name=`UserMessageContentErrorForNonVLM`}},C=class extends Error{constructor(e,t){super(`prefillChunkSize needs to be greater than imageEmbedSize because a single image's prefill cannot be chunked. Got prefillChunkSize: ${e}, imageEmbedSize: ${t}`),this.name=`PrefillChunkSizeSmallerThanImageError`}},w=class extends Error{constructor(){super(`Received image input but model does not have kernel image_embed. Make sure to only pass in image to a vision model.`),this.name=`CannotFindImageEmbedError`}},T=class extends Error{constructor(e){super(`Currently do not support field image_url.detail, but received: ${e}`),this.name=`UnsupportedDetailError`}},ae=class extends Error{constructor(e){super(`image_url.url should start with "data:image" for base64, or with "http", but got: ${e}`),this.name=`UnsupportedImageURLError`}},E=class extends Error{constructor(){super(`Each message can have at most one text contentPart, but received more than 1.`),this.name=`MultipleTextContentError`}},D=class extends Error{constructor(e,t){super(`Internal error: error encountered when parsing outputMessage for function calling. Got outputMessage: ${e}\nGot error: ${t}`),this.name=`ToolCallOutputParseError`}},oe=class extends Error{constructor(e){super(`Internal error: expect output of function calling to be an ${e}`),this.name=`ToolCallOutputInvalidTypeError`}},se=class extends Error{constructor(e,t){super(`Expect generated tool call to have fields ${e.map(e=>`"\`${e}\`"`).join(`, `)}, but got object: ${JSON.stringify(t)}`),this.name=`JSONFieldError`}},ce=class extends Error{constructor(){super("Configuration not initialized. Ensure you have called `reload()` function first."),this.name=`ConfigurationNotInitializedError`}},le=class extends Error{constructor(e){super(`Missing \`model_lib\` for the model with ID "${e}". Please ensure that \`model_lib\` is provided in \`model_list\` for each model. This URL is essential for downloading the WASM library necessary to run the model.`),this.name=`MissingModelError`}},ue=class extends Error{constructor(e){super(`This model requires feature ${e}, which is not yet supported by this browser.`),this.name=`FeatureSupportError`}},de=class extends Error{constructor(e,t){super(`The following fields in ${t} are not yet supported: \n`+e.join(`, `)),this.name=`UnsupportedFieldsError`}},fe=class extends ue{constructor(){super(`This model requires WebGPU extension shader-f16, which is not enabled in this browser. You can try to launch Chrome Canary in command line with flag "--enable-dawn-features=allow_unsafe_apis".`),this.name=`ShaderF16SupportError`}},pe=class extends Error{constructor(){super(`The WebGPU device was lost while loading the model. This issue often occurs due to running out of memory (OOM). To resolve this, try reloading with a model that has fewer parameters or uses a smaller context length.`),this.name=`DeviceLostError`}},me=class extends Error{constructor(e){super(`Cannot handle tokenizer files ${e}`),this.name=`UnsupportedTokenizerFilesError`}},he=class extends Error{constructor(e,t){super(`Only one of context_window_size and sliding_window_size can be positive. Got: context_window_size: ${e}, sliding_window_size: ${t}\nConsider modifying ModelRecord.overrides to set one of them to -1.`),this.name=`WindowSizeConfigurationError`}},ge=class extends Error{constructor(){super("Need to specify non-negative attention_sink_size if using sliding window. Consider modifying ModelRecord.overrides. Use `attention_sink_size=0` for default sliding window."),this.name=`AttentionSinkSizeError`}},_e=class extends Error{constructor(){super(`Need to specify either sliding_window_size or max_window_size.
2
2
  Consider modifying ModelRecord.overrides to set one of them to positive.`),this.name=`WindowSizeSpecificationError`}},ve=class extends Error{constructor(e,t){super(`Prompt tokens exceed context window size: number of prompt tokens: ${e}; context window size: ${t}\nConsider shortening the prompt, or increase \`context_window_size\`, or using sliding window via \`sliding_window_size\`.`),this.name=`ContextWindowSizeExceededError`}},O=class extends Error{constructor(){super("When streaming, `n` cannot be > 1."),this.name=`StreamingCountError`}},ye=class extends Error{constructor(e){super("`seed` should be an integer, but got "+e),this.name=`SeedTypeError`}},be=class extends Error{constructor(){super("JSON schema is only supported with `json_object` response format."),this.name=`InvalidResponseFormatError`}},xe=class extends Error{constructor(){super("When ResponseFormat.type is `grammar`, ResponseFormat.grammar needs to be specified.\nWhen ResponseFormat.grammar is specified, ResponseFormat.type needs to be grammar."),this.name=`InvalidResponseFormatGrammarError`}},Se=class extends Error{constructor(){super("When ResponseFormat.type is `structural_tag`, ResponseFormat.structural_tag needs to be specified.\nWhen ResponseFormat.structural_tag is specified, ResponseFormat.type needs to be structural_tag."),this.name=`InvalidResponseFormatStructuralTagError`}},Ce=class extends Error{constructor(e){super(`When using Hermes-2-Pro function calling via ChatCompletionRequest.tools, cannot specify customized response_format. We will set it for you internally. Currently set to: `+JSON.stringify(e)),this.name=`CustomResponseFormatError`}},we=class extends Error{constructor(e,t){super(`${e} is not supported for ChatCompletionRequest.tools. Currently, models that support function calling are: ${t.join(`, `)}`),this.name=`UnsupportedModelIdError`}},Te=class extends Error{constructor(){super(`When using Hermes-2-Pro function calling via ChatCompletionRequest.tools, cannot specify customized system prompt.`),this.name=`CustomSystemPromptError`}},Ee=class extends Error{constructor(){super(`Only specify stream_options when stream=True.`),this.name=`InvalidStreamOptionsError`}},De=class extends Error{constructor(){super(`Non-chat text completion API expects KVCache to be empty.`),this.name=`TextCompletionExpectsKVEmptyError`}},Oe=class extends Error{constructor(){super(`Non-chat text completion API expects isTextCompletion is true, and prompt is defined.`),this.name=`TextCompletionConversationExpectsPrompt`}},ke=class extends Error{constructor(e){super(`Non-chat text completion API cannot call ${e}.`),this.name=`TextCompletionConversationError`}},Ae=class extends Error{constructor(){super(`Embedding in base64 format is currently not supported.`),this.name=`EmbeddingUnsupportedEncodingFormatError`}},je=class extends Error{constructor(e){super(`Trying to run embeddings.create() with ${e}, which does not have ModelRecord.model_type === ModelType.embedding in the model record. Either make sure an embedding model is loaded, or specify the model type in ModelRecord.`),this.name=`EmbeddingUnsupportedModelError`}},k=class extends Error{constructor(e){super(`Embedding should not use sliding window. However, sliding_window_size=${e} is specified in the chat config.`),this.name=`EmbeddingSlidingWindowError`}},A=class extends Error{constructor(e,t){super(`Embedding currently does not support chunking. Make sure contextWindowSize === prefillChunkSize. Got contextWindowSize=${e}, prefillChunkSize=${t} instead.`),this.name=`EmbeddingChunkingUnsupportedError`}},Me=class extends Error{constructor(e,t){super(`The embedding model you are using only supports up to ${e} context size.However, an input in the batch has size ${t}.`),this.name=`EmbeddingExceedContextWindowSizeError`}},Ne=class extends Error{constructor(){super(`Embedding input cannot be empty string or empty token array.`),this.name=`EmbeddingInputEmptyError`}},Pe=class extends Error{constructor(e,t){super(`Expect chatOpts, if specified, to match the size of modelId. However, got ${e} modelId, but ${t} chatOpts.`),this.name=`ReloadArgumentSizeUnmatchedError`}},Fe=class extends Error{constructor(e,t){super(`Multiple models are loaded in engine. Please specify the model in ${t}.\nCurrently loaded models are:\n${e}`),this.name=`UnclearModelToUseError`}},Ie=class extends Error{constructor(e,t,n){super(`Specified model ${t} for ${n} is not found in loaded models. Please check if the correct model is loaded/specified. Currently loaded models are:\n${e}`),this.name=`SpecifiedModelNotFoundError`}},Le=class extends Error{constructor(e,t,n){super(`${n} expects model to be loaded with ${t}. However, ${e} is not loaded with this pipeline.`),this.name=`IncorrectPipelineLoadedError`}},Re=class extends Error{constructor(e){super(`Need to make models in modelId passed to reload() need to be unique. If you want to, load copies of the same model, consider making copies of the ModelRecord with different model_id. Received modelId: ${e}`),this.name=`ReloadModelIdNotUniqueError`}},ze=class extends Error{constructor(e,t,n){super(`Integrity verification failed for ${e}\n Expected: ${t}\n Actual: ${n}\nThis may indicate file corruption or tampering.`),this.url=e,this.expected=t,this.actual=n,this.name=`IntegrityError`}},j;(function(e){e.user=`user`,e.assistant=`assistant`,e.tool=`tool`})(j||={});var Be;(function(e){e.system=`{system_message}`,e.user=`{user_message}`,e.assistant=`{assistant_message}`,e.tool=`{tool_message}`,e.function=`{function_string}`,e.hermes_tools=`{hermes_tools}`})(Be||={});function Ve(e){function t(e){return e!=null}if(e.frequency_penalty&&(e.frequency_penalty<-2||e.frequency_penalty>2))throw new _(`frequency_penalty`,-2,2);if(e.presence_penalty&&(e.presence_penalty<-2||e.presence_penalty>2))throw new _(`presence_penalty`,-2,2);if(t(e.repetition_penalty)&&e.repetition_penalty<=0)throw new g(`repetition_penalty`,0);if(t(e.max_tokens)&&e.max_tokens<=0)throw new g(`max_tokens`,0);if(t(e.top_p)&&e.top_p<=0||e.top_p>1)throw new _(`top_p`,0,1);if(t(e.temperature)&&e.temperature<0)throw new v(`temperature`);if(t(e.frequency_penalty)&&!t(e.presence_penalty)&&(e.presence_penalty=0,p.warn(`Only frequency_penalty is set; we default presence_penaty to 0.`)),t(e.presence_penalty)&&!t(e.frequency_penalty)&&(e.frequency_penalty=0,p.warn(`Only presence_penalty is set; we default frequency_penalty to 0.`)),t(e.logit_bias))for(let t in e.logit_bias){let n=e.logit_bias[t];if(n>100||n<-100)throw new _(`logit_bias`,-100,100,`Got `+n+` for tokenID `+t);if(isNaN(parseInt(t)))throw new y(`logit_bias's keys`,t)}if(t(e.top_logprobs)){if(!e.logprobs)throw new b(`top_logprobs`,`logprobs`,!0);if(e.top_logprobs<0||e.top_logprobs>5)throw new _(`top_logprobs`,0,5,`Got `+e.top_logprobs)}e.logprobs&&(t(e.top_logprobs)||(e.top_logprobs=0))}var He;(function(e){e[e.LLM=0]=`LLM`,e[e.embedding=1]=`embedding`,e[e.VLM=2]=`VLM`})(He||={});function M(e){return e.cacheBackend===void 0?`cache`:e.cacheBackend}const Ue=[`Hermes-2-Pro-Llama-3-8B-q4f16_1-MLC`,`Hermes-2-Pro-Llama-3-8B-q4f32_1-MLC`,`Hermes-2-Pro-Mistral-7B-q4f16_1-MLC`,`Hermes-3-Llama-3.1-8B-q4f32_1-MLC`,`Hermes-3-Llama-3.1-8B-q4f16_1-MLC`],N={cacheBackend:`cache`,model_list:[{model:`https://huggingface.co/mlc-ai/Llama-3.2-1B-Instruct-q4f32_1-MLC`,model_id:`Llama-3.2-1B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-1B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1128.82,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.2-1B-Instruct-q4f16_1-MLC`,model_id:`Llama-3.2-1B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-1B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:879.04,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.2-1B-Instruct-q0f32-MLC`,model_id:`Llama-3.2-1B-Instruct-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-1B-Instruct-q0f32_cs1k-webgpu.wasm`,vram_required_MB:5106.26,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.2-1B-Instruct-q0f16-MLC`,model_id:`Llama-3.2-1B-Instruct-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-1B-Instruct-q0f16_cs1k-webgpu.wasm`,vram_required_MB:2573.13,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.2-3B-Instruct-q4f32_1-MLC`,model_id:`Llama-3.2-3B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-3B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2951.51,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.2-3B-Instruct-q4f16_1-MLC`,model_id:`Llama-3.2-3B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-3B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2263.69,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.1-8B-Instruct-q4f32_1-MLC`,model_id:`Llama-3.1-8B-Instruct-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5295.7,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-3.1-8B-Instruct-q4f16_1-MLC`,model_id:`Llama-3.1-8B-Instruct-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4598.34,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-3.1-8B-Instruct-q4f32_1-MLC`,model_id:`Llama-3.1-8B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:6101.01,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.1-8B-Instruct-q4f16_1-MLC`,model_id:`Llama-3.1-8B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:5001,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/DeepSeek-R1-Distill-Qwen-7B-q4f16_1-MLC`,model_id:`DeepSeek-R1-Distill-Qwen-7B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5106.67,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/DeepSeek-R1-Distill-Qwen-7B-q4f32_1-MLC`,model_id:`DeepSeek-R1-Distill-Qwen-7B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5900.09,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/DeepSeek-R1-Distill-Llama-8B-q4f32_1-MLC`,model_id:`DeepSeek-R1-Distill-Llama-8B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:6101.01,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/DeepSeek-R1-Distill-Llama-8B-q4f16_1-MLC`,model_id:`DeepSeek-R1-Distill-Llama-8B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:5001,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-2-Theta-Llama-3-8B-q4f16_1-MLC`,model_id:`Hermes-2-Theta-Llama-3-8B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4976.13,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-2-Theta-Llama-3-8B-q4f32_1-MLC`,model_id:`Hermes-2-Theta-Llama-3-8B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:6051.27,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-2-Pro-Llama-3-8B-q4f16_1-MLC`,model_id:`Hermes-2-Pro-Llama-3-8B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4976.13,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-2-Pro-Llama-3-8B-q4f32_1-MLC`,model_id:`Hermes-2-Pro-Llama-3-8B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:6051.27,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-3-Llama-3.2-3B-q4f32_1-MLC`,model_id:`Hermes-3-Llama-3.2-3B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-3B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2951.51,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-3-Llama-3.2-3B-q4f16_1-MLC`,model_id:`Hermes-3-Llama-3.2-3B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3.2-3B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2263.69,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-3-Llama-3.1-8B-q4f32_1-MLC`,model_id:`Hermes-3-Llama-3.1-8B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5779.27,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-3-Llama-3.1-8B-q4f16_1-MLC`,model_id:`Hermes-3-Llama-3.1-8B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4876.13,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Hermes-2-Pro-Mistral-7B-q4f16_1-MLC`,model_id:`Hermes-2-Pro-Mistral-7B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4033.28,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/Phi-3.5-mini-instruct-q4f16_1-MLC`,model_id:`Phi-3.5-mini-instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3.5-mini-instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:3672.07,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Phi-3.5-mini-instruct-q4f32_1-MLC`,model_id:`Phi-3.5-mini-instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3.5-mini-instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5483.12,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Phi-3.5-mini-instruct-q4f16_1-MLC`,model_id:`Phi-3.5-mini-instruct-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3.5-mini-instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2520.07,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Phi-3.5-mini-instruct-q4f32_1-MLC`,model_id:`Phi-3.5-mini-instruct-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3.5-mini-instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:3179.12,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Phi-3.5-vision-instruct-q4f16_1-MLC`,model_id:`Phi-3.5-vision-instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3.5-vision-instruct-q4f16_1_cs2k-webgpu.wasm`,vram_required_MB:3952.18,low_resource_required:!0,overrides:{context_window_size:4096},model_type:He.VLM},{model:`https://huggingface.co/mlc-ai/Phi-3.5-vision-instruct-q4f32_1-MLC`,model_id:`Phi-3.5-vision-instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3.5-vision-instruct-q4f32_1_cs2k-webgpu.wasm`,vram_required_MB:5879.84,low_resource_required:!0,overrides:{context_window_size:4096},model_type:He.VLM},{model:`https://huggingface.co/mlc-ai/Phi-4-mini-instruct-q4f16_1-MLC`,model_id:`Phi-4-mini-instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-4-mini-instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:3437.58,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Phi-4-mini-instruct-q4f32_1-MLC`,model_id:`Phi-4-mini-instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-4-mini-instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:4220.59,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Mistral-7B-Instruct-v0.3-q4f16_1-MLC`,model_id:`Mistral-7B-Instruct-v0.3-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4573.39,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/Mistral-7B-Instruct-v0.3-q4f32_1-MLC`,model_id:`Mistral-7B-Instruct-v0.3-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5619.27,low_resource_required:!1,overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/Mistral-7B-Instruct-v0.2-q4f16_1-MLC`,model_id:`Mistral-7B-Instruct-v0.2-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4573.39,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/OpenHermes-2.5-Mistral-7B-q4f16_1-MLC`,model_id:`OpenHermes-2.5-Mistral-7B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4573.39,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/NeuralHermes-2.5-Mistral-7B-q4f16_1-MLC`,model_id:`NeuralHermes-2.5-Mistral-7B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4573.39,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/WizardMath-7B-V1.1-q4f16_1-MLC`,model_id:`WizardMath-7B-V1.1-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Mistral-7B-Instruct-v0.3-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4573.39,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096,sliding_window_size:-1}},{model:`https://huggingface.co/mlc-ai/SmolLM2-1.7B-Instruct-q4f16_1-MLC`,model_id:`SmolLM2-1.7B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-1.7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1774.19,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-1.7B-Instruct-q4f32_1-MLC`,model_id:`SmolLM2-1.7B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-1.7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2692.38,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-360M-Instruct-q0f16-MLC`,model_id:`SmolLM2-360M-Instruct-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-360M-Instruct-q0f16_cs1k-webgpu.wasm`,vram_required_MB:871.99,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-360M-Instruct-q0f32-MLC`,model_id:`SmolLM2-360M-Instruct-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-360M-Instruct-q0f32_cs1k-webgpu.wasm`,vram_required_MB:1743.99,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-360M-Instruct-q4f16_1-MLC`,model_id:`SmolLM2-360M-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-360M-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:376.06,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-360M-Instruct-q4f32_1-MLC`,model_id:`SmolLM2-360M-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-360M-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:579.61,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-135M-Instruct-q0f16-MLC`,model_id:`SmolLM2-135M-Instruct-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-135M-Instruct-q0f16_cs1k-webgpu.wasm`,vram_required_MB:359.69,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/SmolLM2-135M-Instruct-q0f32-MLC`,model_id:`SmolLM2-135M-Instruct-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/SmolLM2-135M-Instruct-q0f32_cs1k-webgpu.wasm`,vram_required_MB:719.38,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2-2b-it-q4f16_1-MLC`,model_id:`gemma-2-2b-it-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-2b-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1895.3,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2-2b-it-q4f32_1-MLC`,model_id:`gemma-2-2b-it-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-2b-it-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2508.75,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2-2b-it-q4f16_1-MLC`,model_id:`gemma-2-2b-it-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-2b-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1583.3,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/gemma-2-2b-it-q4f32_1-MLC`,model_id:`gemma-2-2b-it-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-2b-it-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1884.75,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/gemma-2-9b-it-q4f16_1-MLC`,model_id:`gemma-2-9b-it-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-9b-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:6422.01,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2-9b-it-q4f32_1-MLC`,model_id:`gemma-2-9b-it-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-9b-it-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:8383.33,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2-2b-jpn-it-q4f16_1-MLC`,model_id:`gemma-2-2b-jpn-it-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-2b-jpn-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1895.3,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2-2b-jpn-it-q4f32_1-MLC`,model_id:`gemma-2-2b-jpn-it-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2-2b-jpn-it-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2508.75,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma3-1b-it-q4f16_1-MLC`,model_id:`gemma3-1b-it-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma3-1b-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:711.07,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/OLMo-2-1124-7B-Instruct-q4f16_1-MLC`,model_id:`OLMo-2-1124-7B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/OLMo-2-1124-7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:6479.01,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/OLMo-2-1124-7B-Instruct-q4f32_1-MLC`,model_id:`OLMo-2-1124-7B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/OLMo-2-1124-7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:9086.02,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/OLMo-2-0425-1B-Instruct-q4f16_1-MLC`,model_id:`OLMo-2-0425-1B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/OLMo-2-0425-1B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1776.75,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/OLMo-2-0425-1B-Instruct-q4f32_1-MLC`,model_id:`OLMo-2-0425-1B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/OLMo-2-0425-1B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2453.51,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-0.6B-q4f16_1-MLC`,model_id:`Qwen3-0.6B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-0.6B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1403.34,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-0.6B-q4f32_1-MLC`,model_id:`Qwen3-0.6B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-0.6B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1924.98,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-0.6B-q0f16-MLC`,model_id:`Qwen3-0.6B-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-0.6B-q0f16_cs1k-webgpu.wasm`,vram_required_MB:2220.38,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-0.6B-q0f32-MLC`,model_id:`Qwen3-0.6B-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-0.6B-q0f32_cs1k-webgpu.wasm`,vram_required_MB:3843.25,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-1.7B-q4f16_1-MLC`,model_id:`Qwen3-1.7B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-1.7B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2036.66,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-1.7B-q4f32_1-MLC`,model_id:`Qwen3-1.7B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-1.7B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2635.44,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-4B-q4f16_1-MLC`,model_id:`Qwen3-4B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-4B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:3431.59,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-4B-q4f32_1-MLC`,model_id:`Qwen3-4B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-4B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:4327.71,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-8B-q4f16_1-MLC`,model_id:`Qwen3-8B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-8B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:5695.78,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3-8B-q4f32_1-MLC`,model_id:`Qwen3-8B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3-8B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:6852.55,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-0.8B-q4f16_1-MLC`,model_id:`Qwen3.5-0.8B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-0.8B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1629.49,low_resource_required:!0,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-0.8B-q4f32_1-MLC`,model_id:`Qwen3.5-0.8B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-0.8B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1894.19,low_resource_required:!0,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-0.8B-q0f16-MLC`,model_id:`Qwen3.5-0.8B-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-0.8B-q0f16_cs1k-webgpu.wasm`,vram_required_MB:2660.27,low_resource_required:!0,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-2B-q4f16_1-MLC`,model_id:`Qwen3.5-2B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-2B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2245.44,low_resource_required:!1,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-2B-q4f32_1-MLC`,model_id:`Qwen3.5-2B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-2B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2591.55,low_resource_required:!1,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-4B-q4f16_1-MLC`,model_id:`Qwen3.5-4B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-4B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:3867.82,low_resource_required:!1,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-4B-q4f32_1-MLC`,model_id:`Qwen3.5-4B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-4B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:4680.36,low_resource_required:!1,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-9B-q4f16_1-MLC`,model_id:`Qwen3.5-9B-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-9B-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:6433.01,low_resource_required:!1,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen3.5-9B-q4f32_1-MLC`,model_id:`Qwen3.5-9B-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen3.5-9B-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:7544.74,low_resource_required:!1,overrides:{context_window_size:4096,max_history_size:1}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-0.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-0.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:944.62,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-0.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-0.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1060.2,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-0.5B-Instruct-q0f16-MLC`,model_id:`Qwen2.5-0.5B-Instruct-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q0f16_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1624.12,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-0.5B-Instruct-q0f32-MLC`,model_id:`Qwen2.5-0.5B-Instruct-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q0f32_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2654.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-1.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-1.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1629.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-1.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-1.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1888.97,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-3B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-3B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2.5-3B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2504.76,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-3B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-3B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2.5-3B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2893.64,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-7B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-7B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5106.67,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-7B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-7B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5900.09,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-0.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-Coder-0.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:944.62,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-0.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-Coder-0.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1060.2,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-0.5B-Instruct-q0f16-MLC`,model_id:`Qwen2.5-Coder-0.5B-Instruct-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q0f16_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1624.12,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-0.5B-Instruct-q0f32-MLC`,model_id:`Qwen2.5-Coder-0.5B-Instruct-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q0f32_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2654.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-1.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-Coder-1.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:1629.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-1.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-Coder-1.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:1888.97,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-3B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-Coder-3B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2.5-3B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2504.76,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-3B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-Coder-3B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2.5-3B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2893.64,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-7B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-Coder-7B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5106.67,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Coder-7B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-Coder-7B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5900.09,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Math-1.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2.5-Math-1.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1629.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2.5-Math-1.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2.5-Math-1.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1888.97,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/stablelm-2-zephyr-1_6b-q4f16_1-MLC`,model_id:`stablelm-2-zephyr-1_6b-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/stablelm-2-zephyr-1_6b-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2087.66,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/stablelm-2-zephyr-1_6b-q4f32_1-MLC`,model_id:`stablelm-2-zephyr-1_6b-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/stablelm-2-zephyr-1_6b-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2999.33,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/stablelm-2-zephyr-1_6b-q4f16_1-MLC`,model_id:`stablelm-2-zephyr-1_6b-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/stablelm-2-zephyr-1_6b-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1511.66,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/stablelm-2-zephyr-1_6b-q4f32_1-MLC`,model_id:`stablelm-2-zephyr-1_6b-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/stablelm-2-zephyr-1_6b-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1847.33,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC`,model_id:`RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/RedPajama-INCITE-Chat-3B-v1-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2972.09,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC`,model_id:`RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/RedPajama-INCITE-Chat-3B-v1-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:3928.09,low_resource_required:!1,overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC`,model_id:`RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/RedPajama-INCITE-Chat-3B-v1-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2041.09,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC`,model_id:`RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/RedPajama-INCITE-Chat-3B-v1-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2558.09,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v1.0-q4f16_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v1.0-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v1.0-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:697.24,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v1.0-q4f32_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v1.0-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v1.0-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:839.98,low_resource_required:!0,overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v1.0-q4f16_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v1.0-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v1.0-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:675.24,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v1.0-q4f32_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v1.0-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v1.0-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:795.98,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Ministral-3-3B-Base-2512-q4f16_1-MLC`,model_id:`Ministral-3-3B-Base-2512-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Ministral-3-3B-Base-2512-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2863.69,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Ministral-3-3B-Base-2512-q4f32_1-MLC`,model_id:`Ministral-3-3B-Base-2512-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Ministral-3-3B-Base-2512-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:3532.37,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Ministral-3-3B-Reasoning-2512-q4f16_1-MLC`,model_id:`Ministral-3-3B-Reasoning-2512-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Ministral-3-3B-Reasoning-2512-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2863.69,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Ministral-3-3B-Reasoning-2512-q4f32_1-MLC`,model_id:`Ministral-3-3B-Reasoning-2512-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Ministral-3-3B-Reasoning-2512-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:3532.37,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Ministral-3-3B-Instruct-2512-BF16-q4f16_1-MLC`,model_id:`Ministral-3-3B-Instruct-2512-BF16-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Ministral-3-3B-Instruct-2512-BF16-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2863.69,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Ministral-3-3B-Instruct-2512-BF16-q4f32_1-MLC`,model_id:`Ministral-3-3B-Instruct-2512-BF16-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Ministral-3-3B-Instruct-2512-BF16-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:3532.37,low_resource_required:!0,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3.1-70B-Instruct-q3f16_1-MLC`,model_id:`Llama-3.1-70B-Instruct-q3f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3_1-70B-Instruct-q3f16_1_cs1k-webgpu.wasm`,vram_required_MB:31153.13,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-0.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2-0.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:944.62,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-0.5B-Instruct-q0f16-MLC`,model_id:`Qwen2-0.5B-Instruct-q0f16-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q0f16_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1624.12,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-0.5B-Instruct-q0f32-MLC`,model_id:`Qwen2-0.5B-Instruct-q0f32-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-0.5B-Instruct-q0f32_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:2654.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-1.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2-1.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1629.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-1.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2-1.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1888.97,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-7B-Instruct-q4f16_1-MLC`,model_id:`Qwen2-7B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5106.67,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-7B-Instruct-q4f32_1-MLC`,model_id:`Qwen2-7B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5900.09,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-Math-1.5B-Instruct-q4f16_1-MLC`,model_id:`Qwen2-Math-1.5B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1629.75,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-Math-1.5B-Instruct-q4f32_1-MLC`,model_id:`Qwen2-Math-1.5B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-1.5B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!0,vram_required_MB:1888.97,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-Math-7B-Instruct-q4f16_1-MLC`,model_id:`Qwen2-Math-7B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f16_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5106.67,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Qwen2-Math-7B-Instruct-q4f32_1-MLC`,model_id:`Qwen2-Math-7B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Qwen2-7B-Instruct-q4f32_1_cs1k-webgpu.wasm`,low_resource_required:!1,vram_required_MB:5900.09,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3-8B-Instruct-q4f32_1-MLC`,model_id:`Llama-3-8B-Instruct-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5295.7,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-3-8B-Instruct-q4f16_1-MLC`,model_id:`Llama-3-8B-Instruct-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4598.34,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-3-8B-Instruct-q4f32_1-MLC`,model_id:`Llama-3-8B-Instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:6101.01,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3-8B-Instruct-q4f16_1-MLC`,model_id:`Llama-3-8B-Instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-8B-Instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:5001,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-3-70B-Instruct-q3f16_1-MLC`,model_id:`Llama-3-70B-Instruct-q3f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-3-70B-Instruct-q3f16_1_cs1k-webgpu.wasm`,vram_required_MB:31153.13,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Phi-3-mini-4k-instruct-q4f16_1-MLC`,model_id:`Phi-3-mini-4k-instruct-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3-mini-4k-instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:3672.07,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Phi-3-mini-4k-instruct-q4f32_1-MLC`,model_id:`Phi-3-mini-4k-instruct-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3-mini-4k-instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5483.12,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Phi-3-mini-4k-instruct-q4f16_1-MLC`,model_id:`Phi-3-mini-4k-instruct-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3-mini-4k-instruct-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2520.07,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Phi-3-mini-4k-instruct-q4f32_1-MLC`,model_id:`Phi-3-mini-4k-instruct-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Phi-3-mini-4k-instruct-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:3179.12,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f32_1-MLC`,model_id:`Llama-2-7b-chat-hf-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-2-7b-chat-hf-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:5284.01,low_resource_required:!1,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC`,model_id:`Llama-2-7b-chat-hf-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-2-7b-chat-hf-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:4618.52,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f32_1-MLC`,model_id:`Llama-2-7b-chat-hf-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-2-7b-chat-hf-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:9109.03,low_resource_required:!1,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC`,model_id:`Llama-2-7b-chat-hf-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-2-7b-chat-hf-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:6749.02,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/Llama-2-13b-chat-hf-q4f16_1-MLC`,model_id:`Llama-2-13b-chat-hf-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/Llama-2-13b-chat-hf-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:11814.09,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2b-it-q4f16_1-MLC`,model_id:`gemma-2b-it-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2b-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1476.52,low_resource_required:!1,buffer_size_required_bytes:262144e3,required_features:[`shader-f16`],overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2b-it-q4f32_1-MLC`,model_id:`gemma-2b-it-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2b-it-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1750.66,low_resource_required:!1,buffer_size_required_bytes:262144e3,overrides:{context_window_size:4096}},{model:`https://huggingface.co/mlc-ai/gemma-2b-it-q4f16_1-MLC`,model_id:`gemma-2b-it-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2b-it-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1476.52,low_resource_required:!0,buffer_size_required_bytes:262144e3,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/gemma-2b-it-q4f32_1-MLC`,model_id:`gemma-2b-it-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/gemma-2b-it-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1750.66,low_resource_required:!0,buffer_size_required_bytes:262144e3,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/phi-2-q4f16_1-MLC`,model_id:`phi-2-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-2-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:3053.97,low_resource_required:!1,required_features:[`shader-f16`],overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/phi-2-q4f32_1-MLC`,model_id:`phi-2-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-2-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:4032.48,low_resource_required:!1,overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/phi-2-q4f16_1-MLC`,model_id:`phi-2-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-2-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:2131.97,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/phi-2-q4f32_1-MLC`,model_id:`phi-2-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-2-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:2740.48,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/phi-1_5-q4f16_1-MLC`,model_id:`phi-1_5-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-1_5-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1210.09,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/phi-1_5-q4f32_1-MLC`,model_id:`phi-1_5-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-1_5-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1682.09,low_resource_required:!0,overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/phi-1_5-q4f16_1-MLC`,model_id:`phi-1_5-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-1_5-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:1210.09,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/phi-1_5-q4f32_1-MLC`,model_id:`phi-1_5-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/phi-1_5-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:1682.09,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q4f16_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v0.4-q4f16_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v0.4-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:697.24,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q4f32_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v0.4-q4f32_1-MLC`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v0.4-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:839.98,low_resource_required:!0,overrides:{context_window_size:2048}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q4f16_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v0.4-q4f16_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v0.4-q4f16_1_cs1k-webgpu.wasm`,vram_required_MB:675.24,low_resource_required:!0,required_features:[`shader-f16`],overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q4f32_1-MLC`,model_id:`TinyLlama-1.1B-Chat-v0.4-q4f32_1-MLC-1k`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/TinyLlama-1.1B-Chat-v0.4-q4f32_1_cs1k-webgpu.wasm`,vram_required_MB:795.98,low_resource_required:!0,overrides:{context_window_size:1024}},{model:`https://huggingface.co/mlc-ai/snowflake-arctic-embed-m-q0f32-MLC`,model_id:`snowflake-arctic-embed-m-q0f32-MLC-b32`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/snowflake-arctic-embed-m-q0f32-ctx512_cs512_batch32-webgpu.wasm`,vram_required_MB:1407.51,model_type:He.embedding},{model:`https://huggingface.co/mlc-ai/snowflake-arctic-embed-m-q0f32-MLC`,model_id:`snowflake-arctic-embed-m-q0f32-MLC-b4`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/snowflake-arctic-embed-m-q0f32-ctx512_cs512_batch4-webgpu.wasm`,vram_required_MB:539.4,model_type:He.embedding},{model:`https://huggingface.co/mlc-ai/snowflake-arctic-embed-s-q0f32-MLC`,model_id:`snowflake-arctic-embed-s-q0f32-MLC-b32`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/snowflake-arctic-embed-s-q0f32-ctx512_cs512_batch32-webgpu.wasm`,vram_required_MB:1022.82,model_type:He.embedding},{model:`https://huggingface.co/mlc-ai/snowflake-arctic-embed-s-q0f32-MLC`,model_id:`snowflake-arctic-embed-s-q0f32-MLC-b4`,model_lib:`https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/v0_2_84/base/snowflake-arctic-embed-s-q0f32-ctx512_cs512_batch4-webgpu.wasm`,vram_required_MB:238.71,model_type:He.embedding}]};function P(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function F(e){return this instanceof F?(this.v=e,this):new F(e)}function I(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof F?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}const We=/^(sha256|sha384|sha512)-([A-Za-z0-9+/]+={0,2})$/,L={sha256:32,sha384:48,sha512:64},Ge={sha256:`SHA-256`,sha384:`SHA-384`,sha512:`SHA-512`};function Ke(e){let t=e.length,n=t%4;if(n===1)return null;let r=e.match(/=+$/),i=r?r[0].length:0;if(i>2||i>0&&n!==0)return null;let a=Math.floor(t/4)*3;return i>0?a-=i:n===2?a+=1:n===3&&(a+=2),a}function qe(e){let t=e.match(We);if(!t)return null;let n=t[1],r=t[2];return Ke(r)===L[n]?{algo:n,hash:r}:null}function Je(e,t,n){return P(this,arguments,void 0,function*(e,t,n,r=`error`){let i=qe(t);if(!i)throw Error(`Invalid SRI hash format: "${t}". Expected format: "sha256-BASE64", "sha384-BASE64", or "sha512-BASE64".`);let{algo:a,hash:o}=i,s=yield crypto.subtle.digest(Ge[a],e),c=new Uint8Array(s),l=``;for(let e=0;e<c.length;e++)l+=String.fromCharCode(c[e]);let u=btoa(l);if(u!==o){let e=`${a}-${u}`;if(r===`warn`){p.warn(`Integrity check failed for ${n}. Expected: ${t}, Got: ${e}`);return}throw new ze(n,t,e)}})}var Ye={exports:{}},R=c(Object.freeze({__proto__:null,default:{}})),Xe=Ye.exports,Ze;function z(){return Ze?Ye.exports:(Ze=1,(function(e,t){(function(e,n){n(t)})(Xe,(function(t){function n(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function r(e){return e!==void 0&&(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`}function i(e){let t=new TextEncoder().encode(e),n=new Uint8Array(t.length+1);for(let e=0;e<t.length;++e)n[e]=t[e];return n[t.length]=0,n}function s(e){let t=[];for(let n of e)t.push(String.fromCharCode(n));return t.join(``)}function c(e,t){if(!e)throw Error(`AssertError:`+(t||``))}function l(){return __dirname+`/wasm`}class u{constructor(){this.modulus=2147483647,this.multiplier=48271,this.increment=0,this.setSeed(Date.now())}setSeed(e){if(!Number.isInteger(e))throw Error(`Seed should be an integer.`);this.rand_state=e%this.modulus,this.rand_state==0&&(this.rand_state=1),this.checkRandState()}nextInt(){let e=this.multiplier*this.rand_state+this.increment;return this.rand_state=e%this.modulus,this.checkRandState(),this.rand_state}randomFloat(){return this.nextInt()/this.modulus}checkRandState(){if(this.rand_state<=0)throw Error(`Random state is unexpectedly not strictly positive.`);if(!Number.isInteger(this.rand_state))throw Error(`Random state is unexpectedly not an integer.`)}}class d{constructor(e){this.wasm32=!0,this.memory=e,this.buffer=this.memory.buffer,this.viewU8=new Uint8Array(this.buffer),this.viewU16=new Uint16Array(this.buffer),this.viewI32=new Int32Array(this.buffer),this.viewU32=new Uint32Array(this.buffer),this.viewF32=new Float32Array(this.buffer),this.viewF64=new Float64Array(this.buffer)}loadU8(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.viewU8[e>>0]}loadU16(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.viewU16[e>>1]}loadU32(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.viewU32[e>>2]}loadI32(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.viewI32[e>>2]}loadI64(e){this.buffer!=this.memory.buffer&&this.updateViews();let t=e>>2;return this.viewI32[t]}loadF32(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.viewF32[e>>2]}loadF64(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.viewF64[e>>3]}loadPointer(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.wasm32?this.loadU32(e):this.loadI64(e)}loadUSize(e){return this.buffer!=this.memory.buffer&&this.updateViews(),this.wasm32?this.loadU32(e):this.loadI64(e)}sizeofPtr(){return this.wasm32?4:8}loadRawBytes(e,t){this.buffer!=this.memory.buffer&&this.updateViews();let n=new Uint8Array(t);return n.set(this.viewU8.slice(e,e+t)),n}loadCString(e){this.buffer!=this.memory.buffer&&this.updateViews();let t=[],n=1;for(;n!=0;)n=this.viewU8[e],n!=0&&t.push(String.fromCharCode(n)),++e;return t.join(``)}storeRawBytes(e,t){this.buffer!=this.memory.buffer&&this.updateViews(),this.viewU8.set(t,e)}loadObjectTypeIndex(e){return this.loadI32(e+8)}loadTypeInfoTypeKey(e){let t=e+8;return this.loadByteArrayAsString(t)}loadSmallStr(e){this.buffer!=this.memory.buffer&&this.updateViews();let t=e+4,n=this.loadU32(t),r=e+4+4,i=[];for(let e=0;e<n;e++)i.push(String.fromCharCode(this.viewU8[r+e]));return i.join(``)}loadSmallBytes(e){this.buffer!=this.memory.buffer&&this.updateViews();let t=e+4,n=this.loadU32(t),r=e+4+4,i=new Uint8Array(n);return i.set(this.viewU8.slice(r,r+n)),i}loadByteArrayAsString(e){this.buffer!=this.memory.buffer&&this.updateViews();let t=this.loadPointer(e),n=this.loadUSize(e+this.sizeofPtr()),r=[];for(let e=0;e<n;e++)r.push(String.fromCharCode(this.viewU8[t+e]));return r.join(``)}loadByteArrayAsBytes(e){this.buffer!=this.memory.buffer&&this.updateViews();let t=this.loadPointer(e),n=this.loadUSize(e+this.sizeofPtr()),r=new Uint8Array(n);return r.set(this.viewU8.slice(t,t+n)),r}updateViews(){this.buffer=this.memory.buffer,this.viewU8=new Uint8Array(this.buffer),this.viewU16=new Uint16Array(this.buffer),this.viewI32=new Int32Array(this.buffer),this.viewU32=new Uint32Array(this.buffer),this.viewF32=new Float32Array(this.buffer),this.viewF64=new Float64Array(this.buffer)}}class f{constructor(e,t,n){this.tempArgs=[],this.stackTop=0,this.basePtr=0,this.addressToSetTargetValue=[],this.memory=e,this.cAllocSpace=t,this.cFreeSpace=n,this.buffer=new ArrayBuffer(128),this.basePtr=this.cAllocSpace(128),this.viewU8=new Uint8Array(this.buffer),this.viewI32=new Int32Array(this.buffer),this.viewU32=new Uint32Array(this.buffer),this.viewF64=new Float64Array(this.buffer),this.updateViews()}dispose(){this.basePtr!=0&&(this.cFreeSpace(this.basePtr),this.basePtr=0)}reset(){for(this.stackTop=0,c(this.addressToSetTargetValue.length===0);this.tempArgs.length!=0;)this.tempArgs.pop().dispose()}commitToWasmMemory(e=this.stackTop){for(;this.addressToSetTargetValue.length!=0;){let[e,t]=this.addressToSetTargetValue.pop();this.storePtr(e,this.ptrFromOffset(t))}this.memory.storeRawBytes(this.basePtr,this.viewU8.slice(0,e))}allocRawBytes(e){if(e=e+7>>3<<3,this.stackTop+e>this.buffer.byteLength){let t=Math.max(this.buffer.byteLength*2,this.stackTop+e),n=this.viewU8;this.buffer=new ArrayBuffer(t),this.updateViews(),this.viewU8.set(n),this.basePtr!=0&&this.cFreeSpace(this.basePtr),this.basePtr=this.cAllocSpace(t)}let t=this.stackTop;return this.stackTop+=e,t}allocPtrArray(e){return this.allocRawBytes(this.memory.sizeofPtr()*e)}ptrFromOffset(e){return this.basePtr+e}storePtr(e,t){this.memory.wasm32?this.storeU32(e,t):this.storeI64(e,t)}storeUSize(e,t){this.memory.wasm32?this.storeU32(e,t):this.storeI64(e,t)}storeI32(e,t){this.viewI32[e>>2]=t}storeU32(e,t){this.viewU32[e>>2]=t}storeI64(e,t){let n=t&4294967295,r=e>>2;this.viewI32[r]=n,this.viewI32[r+1]=t<0?-1:0}storeF64(e,t){this.viewF64[e>>3]=t}storeRawBytes(e,t){this.viewU8.set(t,e)}allocByteArrayForString(e){let t=i(e),n=this.allocRawBytes(this.memory.sizeofPtr()*2),r=this.allocRawBytes(t.length);return this.storeUSize(n+this.memory.sizeofPtr(),e.length),this.storeRawBytes(r,t),this.addressToSetTargetValue.push([n,r]),n}allocThenSetArgString(e,t){let n=i(t),r=this.allocRawBytes(n.length);this.storeRawBytes(r,n),this.addressToSetTargetValue.push([e,r])}allocThenSetArgBytes(e,t){let n=this.allocRawBytes(this.memory.sizeofPtr()*2),r=this.allocRawBytes(t.length);this.storeRawBytes(r,t),this.storeUSize(n+this.memory.sizeofPtr(),t.length),this.addressToSetTargetValue.push([e,n]),this.addressToSetTargetValue.push([n,r])}updateViews(){this.viewU8=new Uint8Array(this.buffer),this.viewI32=new Int32Array(this.buffer),this.viewU32=new Uint32Array(this.buffer),this.viewF64=new Float64Array(this.buffer)}}function p(e){if(e.wasmLibraryProvider&&e.wasmLibraryProvider.start&&e.wasmLibraryProvider.imports!==void 0){let t=e;return{imports:t.wasmLibraryProvider.imports,start:e=>{t.wasmLibraryProvider.start(e)}}}else if(e.imports&&e.start!==void 0)return e;else if(e.wasiImport&&e.start!==void 0)return{imports:{wasi_snapshot_preview1:e.wasiImport},start:t=>{e.start(t)}};else return}class m{constructor(e={},t=console.log){this.packedCFuncTable=[void 0],this.packedCFuncTableFreeId=[],this.logger=t,this.libProvider=p(e),this.libProvider===void 0?this.imports=e:this.imports=this.libProvider.imports,this.imports.env=this.environment(this.imports.env)}start(e){this.libProvider!==void 0&&this.libProvider.start(e)}environment(e){return Object.assign({__cxa_thread_atexit:()=>{},emscripten_notify_memory_growth:e=>{}},e,{TVMFFIWasmSafeCall:(e,t,n,r)=>{let i=this.packedCFuncTable[e];return c(i!==void 0),i(e,t,n,r)},TVMFFIWasmFunctionDeleter:e=>{this.packedCFuncTable[e]=void 0,this.packedCFuncTableFreeId.push(e)},__console_log:e=>{this.logger(e)}})}}class h{constructor(e,t){this.state=0,this.storedPromiseBeforeUnwind=null,this.storedValueBeforeRewind=null,this.storedExceptionBeforeRewind=null,this.exports=e,this.initMemory(t)}enabled(){return this.exports.asyncify_stop_rewind!==void 0}isNormalStackState(){return this.state==0}getState(){return this.state}wrapImport(e){return(...t)=>{if(this.getState()==2)if(this.stopRewind(),this.storedValueBeforeRewind!==null){c(this.storedExceptionBeforeRewind===null);let e=this.storedValueBeforeRewind;return this.storedValueBeforeRewind=null,e}else{c(this.storedValueBeforeRewind===null);let e=this.storedExceptionBeforeRewind;throw this.storedExceptionBeforeRewind=null,e}c(this.getState()==0);let n=e(...t);if(r(n)){this.startUnwind(),c(this.storedPromiseBeforeUnwind==null),this.storedPromiseBeforeUnwind=n;return}else return n}}wrapExport(e){return(...t)=>n(this,void 0,void 0,function*(){c(this.getState()==0);let n=e(...t);for(;this.getState()==1;){this.stopUnwind();let i=this.storedPromiseBeforeUnwind;this.storedPromiseBeforeUnwind=null,c(this.storedExceptionBeforeRewind===null),c(this.storedValueBeforeRewind==null);try{this.storedValueBeforeRewind=yield i}catch(e){this.storedExceptionBeforeRewind=e}c(!r(this.storedValueBeforeRewind)),c(this.getState()==0),this.startRewind(),n=e(...t)}return n})}startRewind(){if(this.exports.asyncify_start_rewind===void 0)throw Error(`Asynctify is not enabled, please compile with -s ASYNCIFY=1 in emcc`);this.exports.asyncify_start_rewind(16),this.state=2}stopRewind(){if(this.exports.asyncify_stop_rewind===void 0)throw Error(`Asynctify is not enabled, please compile with -s ASYNCIFY=1 in emcc`);this.exports.asyncify_stop_rewind(),this.state=0}startUnwind(){if(this.exports.asyncify_start_unwind===void 0)throw Error(`Asynctify is not enabled, please compile with -s ASYNCIFY=1 in emcc`);this.exports.asyncify_start_unwind(16),this.state=1}stopUnwind(){if(this.exports.asyncify_stop_unwind===void 0)throw Error(`Asynctify is not enabled, please compile with -s ASYNCIFY=1 in emcc`);this.exports.asyncify_stop_unwind(),this.state=0}initMemory(e){new Int32Array(e.buffer,16,2).set([24,1024])}}function g(){return n(this,arguments,void 0,function*(e=`high-performance`){if(typeof navigator<`u`&&navigator.gpu!==void 0){let t=yield navigator.gpu.requestAdapter({powerPreference:e});if(t==null)throw Error(`Unable to find a compatible GPU. This issue might be because your computer doesn't have a GPU, or your system settings are not configured properly. Please check if your device has a GPU properly set up and if your your browser supports WebGPU. You can also consult your browser's compatibility chart to see if it supports WebGPU. For more information about WebGPU support in your browser, visit https://webgpureport.org/`);let n=e=>Math.ceil(e/(1<<20))+`MB`,r=1<<30;if(r>t.limits.maxBufferSize){let e=1<<28;if(console.log(`Requested maxBufferSize exceeds limit. \nrequested=${n(r)}, \nlimit=${n(t.limits.maxBufferSize)}. \nWARNING: Falling back to ${n(e)}...`),r=e,e>t.limits.maxBufferSize)throw Error(`Cannot initialize runtime because of requested maxBufferSize exceeds limit. requested=${n(e)}, limit=${n(t.limits.maxBufferSize)}. Consider upgrading your browser.`)}let i=1<<30;if(i>t.limits.maxStorageBufferBindingSize){let e=1<<27;if(console.log(`Requested maxStorageBufferBindingSize exceeds limit. \nrequested=${n(i)}, \nlimit=${n(t.limits.maxStorageBufferBindingSize)}. \nWARNING: Falling back to ${n(e)}...`),i=e,e>t.limits.maxStorageBufferBindingSize)throw Error(`Cannot initialize runtime because of requested maxStorageBufferBindingSize exceeds limit. requested=${n(e)}, limit=${n(t.limits.maxStorageBufferBindingSize)}. `)}let a=32768;if(a>t.limits.maxComputeWorkgroupStorageSize)throw Error(`Cannot initialize runtime because of requested maxComputeWorkgroupStorageSize exceeds limit. requested=${a}, limit=${t.limits.maxComputeWorkgroupStorageSize}. `);if(10>t.limits.maxStorageBuffersPerShaderStage)throw Error(`Cannot initialize runtime because of requested maxStorageBuffersPerShaderStage exceeds limit. requested=10, limit=${t.limits.maxStorageBuffersPerShaderStage}. `);let o=[1024,512,256],s=t.limits.maxComputeInvocationsPerWorkgroup,c=o.find(e=>e<=s)||void 0;c===void 0?console.log(`No candidate fits device limit=${s}; will rely on defaults`):c!==1024&&console.log(`Falling back to maxComputeInvocationsPerWorkgroup=${c} due to device limit=${s}`);let l=[];return t.features.has(`shader-f16`)&&l.push(`shader-f16`),t.features.has(`subgroups`)&&l.push(`subgroups`),{adapter:t,adapterInfo:t.info||(yield t.requestAdapterInfo()),device:yield t.requestDevice({requiredLimits:{maxBufferSize:r,maxStorageBufferBindingSize:i,maxComputeWorkgroupStorageSize:a,maxStorageBuffersPerShaderStage:10,maxComputeInvocationsPerWorkgroup:c},requiredFeatures:l})}}else return})}function _(e,t){e.pushErrorScope(`out-of-memory`),e.pushErrorScope(`validation`),e.pushErrorScope(`internal`);let n=e.createBuffer(t);return e.popErrorScope().then(t=>{t&&(e.destroy(),console.error(t))}),e.popErrorScope().then(t=>{t&&(e.destroy(),console.error(t))}),e.popErrorScope().then(t=>{t&&(e.destroy(),console.error(t))}),n}let v=`
3
3
  @group(0) @binding(0) var my_sampler : sampler;
4
4
  @group(0) @binding(1) var my_texture : texture_2d<f32>;
@@ -1,4 +1,4 @@
1
- import{t as e}from"./base-task-model-CYkpwnvU-DDfHUUIS.js";import{t}from"./prompt-utils-DpfOVJQv-DorZAfZa.js";var n={"formal|plain-text|short":`You are a direct-instruction text generation AI. Your SOLE PURPOSE is to generate text that precisely fulfills the user's 'INSTRUCTIONS' and adheres to all specified parameters. Your task is to PERFORM the request to CREATE text, not to talk about it, summarize it, or repeat it. You must synthesize the information provided to create a new, original response.
1
+ import{t as e}from"./base-task-model-CYkpwnvU-DrXr4G1R.js";import{t}from"./prompt-utils-DpfOVJQv-DorZAfZa.js";var n={"formal|plain-text|short":`You are a direct-instruction text generation AI. Your SOLE PURPOSE is to generate text that precisely fulfills the user's 'INSTRUCTIONS' and adheres to all specified parameters. Your task is to PERFORM the request to CREATE text, not to talk about it, summarize it, or repeat it. You must synthesize the information provided to create a new, original response.
2
2
 
3
3
  ---
4
4
  **CRITICAL RULES (NON-NEGOTIABLE - YOU MUST FOLLOW THESE PERFECTLY):**